File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 88import pytest
99
1010
11- _cache = {}
11+ _django_settings_is_configured = None
1212
1313
1414def skip_if_no_django ():
@@ -24,17 +24,17 @@ def django_settings_is_configured():
2424 configured flag in the Django settings object if django.conf has already
2525 been imported.
2626 """
27- try :
28- return _cache [ "django_is_configured" ]
29- except KeyError :
27+ global _django_settings_is_configured
28+
29+ if _django_settings_is_configured is None :
3030 ret = bool (os .environ .get ("DJANGO_SETTINGS_MODULE" ))
3131
3232 if not ret and "django.conf" in sys .modules :
3333 ret = sys .modules ["django.conf" ].settings .configured
3434
35- _cache [ "django_is_configured" ] = ret
35+ _django_settings_is_configured = ret
3636
37- return ret
37+ return _django_settings_is_configured
3838
3939
4040def get_django_version ():
You can’t perform that action at this time.
0 commit comments