Skip to content

Commit

Permalink
Work around "no settings module" crash (#65)
Browse files Browse the repository at this point in the history
Workaround "no settings module" crash
  • Loading branch information
mkurnikov authored Apr 12, 2019
1 parent aeb435c commit fd06816
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mypy_django_plugin/transformers/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

def get_setting_sym(name: str, api: 'TypeChecker', settings_modules: List[str]) -> Optional[SymbolTableNode]:
for settings_mod_name in settings_modules:
if settings_mod_name not in api.modules:
continue

file = api.modules[settings_mod_name]
sym = file.names.get(name)
if sym is not None:
Expand Down

0 comments on commit fd06816

Please sign in to comment.