Skip to content

Commit 6c84005

Browse files
dickreuterjreback
authored andcommitted
ModuleNotFoundError in in_interactive_session (#24714)
1 parent f02b548 commit 6c84005

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/io/formats/console.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ def in_interactive_session():
9595
from pandas import get_option
9696

9797
def check_main():
98-
import __main__ as main
98+
try:
99+
import __main__ as main
100+
except ModuleNotFoundError:
101+
return get_option('mode.sim_interactive')
99102
return (not hasattr(main, '__file__') or
100103
get_option('mode.sim_interactive'))
101104

0 commit comments

Comments
 (0)