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):