Skip to content

Commit

Permalink
Make read_dotenv work when no file
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed May 9, 2024
1 parent 333d4d6 commit 29c3a60
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions framework/internal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def read_dotenv(file='.env') -> dict[str, str]:
This function reads a .env file and returns a dictionary of the key-value
"""

if not os.path.exists(file):
return {}

dotenv = {}
with open(file) as f:
for line in f:
Expand Down

0 comments on commit 29c3a60

Please sign in to comment.