Skip to content

Improve interactive mode detection#183

Merged
theskumar merged 2 commits intomasterfrom
pr-102
Jun 2, 2019
Merged

Improve interactive mode detection#183
theskumar merged 2 commits intomasterfrom
pr-102

Conversation

@theskumar
Copy link
Copy Markdown
Owner

@theskumar theskumar commented Jun 2, 2019

Previously, this checked whether __file__ was defined in globals(). globals()
is tied to the current module, so this will always be defined. Fix this by
importing __main__ and asking whether it has __file__ defined. This approach is
outlined in https://stackoverflow.com/a/2356420.

Thanks @andrewsmith

Previously, this checked whether __file__ was defined in globals().  globals()
is tied to the current module, so this will always be defined. Fix this by
importing __main__ and asking whether it has __file__ defined. This approach is
outlined in stackoverflow.com/a/2356420.

Thanks @andrewsmith
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 89.757% when pulling ad75a0a on pr-102 into 436b1be on master.

1 similar comment
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 89.757% when pulling ad75a0a on pr-102 into 436b1be on master.

@coveralls
Copy link
Copy Markdown

coveralls commented Jun 2, 2019

Coverage Status

Coverage decreased (-0.5%) to 89.757% when pulling 477a854 on pr-102 into 436b1be on master.

@theskumar theskumar merged commit a1c6eb5 into master Jun 2, 2019
@theskumar theskumar deleted the pr-102 branch June 2, 2019 17:15
johnbergvall pushed a commit to johnbergvall/python-dotenv that referenced this pull request Aug 13, 2021
* Improve interactive mode detection

Previously, this checked whether __file__ was defined in globals().  globals()
is tied to the current module, so this will always be defined. Fix this by
importing __main__ and asking whether it has __file__ defined. This approach is
outlined in stackoverflow.com/a/2356420.

Thanks @andrewsmith
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants