We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ffcef6 commit 0b94ac0Copy full SHA for 0b94ac0
src/dotenv/main.py
@@ -280,7 +280,10 @@ def find_dotenv(
280
281
def _is_interactive():
282
""" Decide whether this is running in a REPL or IPython notebook """
283
- main = __import__('__main__', None, None, fromlist=['__file__'])
+ try:
284
+ main = __import__('__main__', None, None, fromlist=['__file__'])
285
+ except ModuleNotFoundError:
286
+ return False
287
return not hasattr(main, '__file__')
288
289
if usecwd or _is_interactive() or getattr(sys, 'frozen', False):
0 commit comments