diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-04-04 11:09:34 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-04-04 11:09:34 -0400 |
commit | 4e0b345af1f6d64e184a87fd3d03f5f73665afb6 (patch) | |
tree | 182ac1f8d7b5543476185557421650a0de584ab1 /alembic/environment.py | |
parent | a9fa7d9651df412a405b848f1bb5848fde5200f1 (diff) | |
download | alembic-4e0b345af1f6d64e184a87fd3d03f5f73665afb6.tar.gz |
- Fixed bug where :meth:`.EnvironmentContext.get_x_argument`
would fail if the :class:`.Config` in use didn't actually
originate from a command line call. fixes #195
Diffstat (limited to 'alembic/environment.py')
-rw-r--r-- | alembic/environment.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/alembic/environment.py b/alembic/environment.py index 0c9095d..cba3beb 100644 --- a/alembic/environment.py +++ b/alembic/environment.py @@ -246,7 +246,10 @@ class EnvironmentContext(object): :attr:`.Config.cmd_opts` """ - value = self.config.cmd_opts.x or [] + if self.config.cmd_opts is not None: + value = self.config.cmd_opts.x or [] + else: + value = [] if as_dictionary: value = dict( arg.split('=', 1) for arg in value |