Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix ModuleNotFoundError when called with pytest in some circumstances
  • Loading branch information
dickreuter committed Jan 11, 2019
commit 29515f9f30f8d19a3e64a09e81d62811403ebb63
5 changes: 4 additions & 1 deletion pandas/io/formats/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ def in_interactive_session():
from pandas import get_option

def check_main():
import __main__ as main
try:
import __main__ as main
except ModuleNotFoundError:
return get_option('mode.sim_interactive')
return (not hasattr(main, '__file__') or
get_option('mode.sim_interactive'))

Expand Down