summaryrefslogtreecommitdiff
path: root/django/conf/__init__.py
diff options
context:
space:
mode:
authorOndrej Sika <ondrej@ondrejsika.com>2013-12-18 18:13:40 +0100
committerTim Graham <timograham@gmail.com>2013-12-18 18:23:25 -0500
commit4ac5def4a27802fb16a8941195bc0d98b9e2e35c (patch)
treeac8caa1ecc197515e536337fab66a1b6bee00d9d /django/conf/__init__.py
parenta39d672ec7d53637805a61b45a51bc0e7d297a36 (diff)
Simplied some code in django.conf.__init__.
Diffstat (limited to 'django/conf/__init__.py')
-rw-r--r--django/conf/__init__.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
index 37982e76ad..ac074d5166 100644
--- a/django/conf/__init__.py
+++ b/django/conf/__init__.py
@@ -34,11 +34,8 @@ class LazySettings(LazyObject):
is used the first time we need any settings at all, if the user has not
previously configured the settings manually.
"""
- try:
- settings_module = os.environ[ENVIRONMENT_VARIABLE]
- if not settings_module: # If it's set but is an empty string.
- raise KeyError
- except KeyError:
+ settings_module = os.environ.get(ENVIRONMENT_VARIABLE)
+ if not settings_module:
desc = ("setting %s" % name) if name else "settings"
raise ImproperlyConfigured(
"Requested %s, but settings are not configured. "