Skip to content

Commit

Permalink
jpadilla#26 Removing PY33, as interpreter no longer support by Travis…
Browse files Browse the repository at this point in the history
… CI.
  • Loading branch information
alexdlaird committed Dec 11, 2017
1 parent 6f6cac1 commit 8836e69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -8,7 +8,6 @@ sudo: false
env:
- TOX_ENV=py27-flake8
- TOX_ENV=py27
- TOX_ENV=py33
- TOX_ENV=py34
- TOX_ENV=py35

Expand Down
10 changes: 5 additions & 5 deletions dotenv.py
Expand Up @@ -34,17 +34,17 @@
""", re.IGNORECASE | re.VERBOSE)


def read_dotenv(dotenv=None, overwrite=False):
def read_dotenv(dotenv=None, override=False):
"""
Read a .env file into os.environ.
If not given a path to a dotenv path, does filthy magic stack backtracking
to find manage.py and then find the dotenv.
If tests rely on .env files, setting the overwrite flag to True is a safe way to ensure tests run consistently
across all environments.
If tests rely on .env files, setting the overwrite flag to True is a safe
way to ensure tests run consistently across all environments.
:param overwrite: True if values in .env should overwrite export environment variables.
:param override: True if values in .env should override system variables.
"""
if dotenv is None:
frame_filename = sys._getframe().f_back.f_code.co_filename
Expand All @@ -56,7 +56,7 @@ def read_dotenv(dotenv=None, overwrite=False):
if os.path.exists(dotenv):
with open(dotenv) as f:
for k, v in parse_dotenv(f.read()).items():
if overwrite:
if override:
os.environ[k] = v
else:
os.environ.setdefault(k, v)
Expand Down

0 comments on commit 8836e69

Please sign in to comment.