From 09a8867edd9bf32ec594bea869cf691ba86a9f2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Domen=20Ko=C5=BEar?= <domen@dev.si>
Date: Sat, 5 Feb 2011 14:16:00 +0100
Subject: [PATCH] fixes #106

---
 docs/changelog.rst              |  3 +++
 migrate/versioning/script/py.py | 13 +++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/docs/changelog.rst b/docs/changelog.rst
index c1a2eeb..8b1e31a 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -13,7 +13,10 @@ Fixed bugs
 ******************
 
 - updated tests for Python 2.7
+- repository keyword in :func:`api.version_control` can also be unicode
 - added if main condition for manage.py script
+- make :func:`migrate.changeset.constraint.ForeignKeyConstraint.autoname`
+  work with SQLAlchemy 0.5 and 0.6
 - fixed case sensitivity in setup.py dependencies
 - moved :mod:`migrate.changeset.exceptions` and :mod:`migrate.versioning.exceptions`
   to :mod:`migrate.exceptions`
diff --git a/migrate/versioning/script/py.py b/migrate/versioning/script/py.py
index ed5b87e..5089d18 100644
--- a/migrate/versioning/script/py.py
+++ b/migrate/versioning/script/py.py
@@ -4,6 +4,7 @@
 import shutil
 import warnings
 import logging
+import inspect
 from StringIO import StringIO
 
 import migrate
@@ -136,12 +137,12 @@ class PythonScript(base.BaseScript):
         funcname = base.operations[op]
         script_func = self._func(funcname)
 
-        try:
-            script_func(engine)
-        except TypeError:
-            warnings.warn("upgrade/downgrade functions must accept engine"
-                " parameter (since version > 0.5.4)", MigrateDeprecationWarning)
-            raise
+        # check for old way of using engine
+        if not inspect.getargspec(script_func).args:
+            raise TypeError("upgrade/downgrade functions must accept engine"
+                " parameter (since version 0.5.4)")
+
+        script_func(engine)
 
     @property
     def module(self):