Skip to content

Commit

Permalink
Merge pull request #596 from safehammad/dumpscript_import_helper_fix
Browse files Browse the repository at this point in the history
Fix check for missing import_helper module in dumpscript (Python 3.3+).
  • Loading branch information
trbs committed Jan 12, 2015
2 parents cfd18ff + 7374f4c commit 214a02e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django_extensions/management/commands/dumpscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,8 @@ def save_or_locate(self, the_obj):
# has no knowlodge of this class
importer = type("DynamicImportHelper", (import_helper.ImportHelper, BasicImportHelper ) , {} )()
except ImportError as e:
if str(e) == "No module named import_helper":
# From Python 3.3 we can check e.name - string match is for backward compatibility.
if 'import_helper' in str(e):
importer = BasicImportHelper()
else:
raise
Expand Down

0 comments on commit 214a02e

Please sign in to comment.