Skip to content

add _is_debugger so load_dotenv will work in pdb - #553

Merged
theskumar merged 1 commit into
theskumar:mainfrom
randomseed42:add-is-debugger
Mar 25, 2025
Merged

theskumar merged 1 commit into
theskumar:mainfrom
randomseed42:add-is-debugger

Conversation

@randomseed42

@randomseed42 randomseed42 commented Mar 19, 2025 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Owner

Taking a look and will merge after testing it out.

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

Labels

None yet

2 participants