mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-07 12:44:29 +08:00
Work around "no settings module" crash (#65)
Workaround "no settings module" crash
This commit is contained in:
@@ -13,6 +13,9 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
def get_setting_sym(name: str, api: 'TypeChecker', settings_modules: List[str]) -> Optional[SymbolTableNode]:
|
def get_setting_sym(name: str, api: 'TypeChecker', settings_modules: List[str]) -> Optional[SymbolTableNode]:
|
||||||
for settings_mod_name in settings_modules:
|
for settings_mod_name in settings_modules:
|
||||||
|
if settings_mod_name not in api.modules:
|
||||||
|
continue
|
||||||
|
|
||||||
file = api.modules[settings_mod_name]
|
file = api.modules[settings_mod_name]
|
||||||
sym = file.names.get(name)
|
sym = file.names.get(name)
|
||||||
if sym is not None:
|
if sym is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user