diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-10-06 15:15:08 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-10-07 11:29:40 +0100 |
commit | e785acb252edf74791d7eb356e2b68a05a338d33 (patch) | |
tree | 47a21a0a5b2ba32c3a59cee317f2df383ec99d22 | |
parent | 4e2f04721d4724ad74cce3645a59eedb84c8fc6d (diff) | |
download | morph-e785acb252edf74791d7eb356e2b68a05a338d33.tar.gz |
fixup! import: Raise error on invalid .lorry file
-rw-r--r-- | import/main.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/import/main.py b/import/main.py index cf5836c1..c174dc62 100644 --- a/import/main.py +++ b/import/main.py @@ -20,6 +20,7 @@ import cliapp import morphlib import networkx +import six import contextlib import copy @@ -153,9 +154,9 @@ class LorrySet(object): raise cliapp.AppException( 'Invalid lorry %s: %s' % (filename, lorry_entry)) - if not isinstance(info['url'], str): + if not isinstance(info.get('url'), six.string_types): raise cliapp.AppException( - 'Invalid URL in lorry %s: %s' % (filename, info['url'])) + 'Invalid URL in lorry %s: %s' % (filename, info.get('url'))) if project_name in self.data: stored_lorry = self.get_lorry(project_name) |