Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/dotenv/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ def _is_interactive():
return False
return not hasattr(main, "__file__")

if usecwd or _is_interactive() or getattr(sys, "frozen", False):
def _is_debugger():
return sys.gettrace() is not None

if usecwd or _is_interactive() or _is_debugger() or getattr(sys, "frozen", False):
# Should work without __file__, e.g. in REPL or IPython notebook.
path = os.getcwd()
else:
Expand Down