I've encountered a problem with the following code (in
migrate/versioning/py.py):
---
try:
script_func(engine)
except TypeError:
warnings.warn("upgrade/downgrade functions must accept engine"
" parameter (since version > 0.5.4)", exceptions.MigrateDeprecationWarning)
raise
---
The try/except clause is not the proper way to detect if the upgrade/downgrade
functions accept a parameter or not. If you make a mistake somewhere in one of
these function that raises a TypeError, you get the misleading
MigrateDeprecationWarning instead of a clear failure. I guess it would be
better to check the signature by introspection in this particular case.
Example that triggers the misleading error:
def upgrade(migration_engine)
raise TypeError() # oops, I have a bug in my upgrade code
Original issue reported on code.google.com by sylvain....@gmail.com on 4 Dec 2010 at 11:18
Original issue reported on code.google.com by
sylvain....@gmail.com
on 4 Dec 2010 at 11:18