Skip to content

Commit

Permalink
Display correct error message for missing imports
Browse files Browse the repository at this point in the history
Resolves django-extensions#955
- When a missing import is found in a script, this changes the error
message displayed to indicate that there's a missing import, rather than
giving a generic error message similar to the one raised when the script
does not exist
  • Loading branch information
kevgathuku committed Sep 18, 2016
1 parent af9f78c commit 8340e2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_extensions/management/commands/runscript.py
Expand Up @@ -107,7 +107,7 @@ def my_import(mod):
finally:
exc_traceback = None

if verbosity > 1:
if verbosity > 0 and not silent:
if verbosity > 2:
traceback.print_exc()
print(ERROR("Cannot import module '%s': %s." % (mod, e)))
Expand Down

0 comments on commit 8340e2b

Please sign in to comment.