Merge pull request #2827 from schafle/fix-2823

[Fixed 2823] Checking if .env is file before prompting to install dotenv
This commit is contained in:
Hsiaoming Yang 2018-06-14 10:12:20 +09:00 committed by GitHub
commit b2ec6a33a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -584,7 +584,7 @@ def load_dotenv(path=None):
.. versionadded:: 1.0
"""
if dotenv is None:
if path or os.path.exists('.env') or os.path.exists('.flaskenv'):
if path or os.path.isfile('.env') or os.path.isfile('.flaskenv'):
click.secho(
' * Tip: There are .env files present.'
' Do "pip install python-dotenv" to use them.',