Skip to content

Commit fd06816

Browse files
authored
Work around "no settings module" crash (#65)
Workaround "no settings module" crash
1 parent aeb435c commit fd06816

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mypy_django_plugin/transformers/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
def get_setting_sym(name: str, api: 'TypeChecker', settings_modules: List[str]) -> Optional[SymbolTableNode]:
1515
for settings_mod_name in settings_modules:
16+
if settings_mod_name not in api.modules:
17+
continue
18+
1619
file = api.modules[settings_mod_name]
1720
sym = file.names.get(name)
1821
if sym is not None:

0 commit comments

Comments
 (0)