KEMBAR78
add _is_debugger so load_dotenv will work in pdb by randomseed42 · Pull Request #553 · theskumar/python-dotenv · GitHub
Skip to content

Conversation

@randomseed42
Copy link
Contributor

@randomseed42 randomseed42 commented Mar 19, 2025

add below to find_dotenv, so that when user run load_dotenv() in pdb or other debugger, they can still load the .env file in current working directory, otherwise current frame_filename will goes to Lib/bdb.py

def _is_debugger():
    return sys.gettrace() is not None

if usecwd or _is_interactive() or _is_debugger() or getattr(sys, "frozen", False):
    ...

@theskumar
Copy link
Owner

Taking a look and will merge after testing it out.

@theskumar theskumar merged commit 8dd413e into theskumar:main Mar 25, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants