diff options
author | Marc Abramowitz <marc@marc-abramowitz.com> | 2014-05-28 08:54:28 -0700 |
---|---|---|
committer | Marc Abramowitz <marc@marc-abramowitz.com> | 2014-05-28 08:54:28 -0700 |
commit | 0a93da93d011118d9446e0ef7b4d5d80e550adfb (patch) | |
tree | 37a9f36d43bd33be2f5e5a1a5d87862c5096f1f2 /alembic/migration.py | |
parent | bd8a8dc60dafcfc9e6750d2a48c51b8fc5df0e28 (diff) | |
download | alembic-0a93da93d011118d9446e0ef7b4d5d80e550adfb.tar.gz |
Eliminate {} (dict) default arg value for `opts`
to MigrationContext.configure
Using a mutable type as a default value is a common source of obscure
problems.
See
http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments
Diffstat (limited to 'alembic/migration.py')
-rw-r--r-- | alembic/migration.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/alembic/migration.py b/alembic/migration.py index e5de70f..dadf49a 100644 --- a/alembic/migration.py +++ b/alembic/migration.py @@ -117,7 +117,7 @@ class MigrationContext(object): url=None, dialect_name=None, environment_context=None, - opts={}, + opts=None, ): """Create a new :class:`.MigrationContext`. @@ -139,6 +139,9 @@ class MigrationContext(object): this dictionary. """ + if opts is None: + opts = {} + if connection: dialect = connection.dialect elif url: |