Skip to content

Commit fe6e627

Browse files
committed
better checking for setup.py in module init
1 parent bc436ba commit fe6e627

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

plotdevice/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class DeviceError(Exception):
1111
import sys, re
1212
called_from = getattr(sys.modules['__main__'], '__file__', '<interactive>')
1313
is_windowed = bool(re.search(r'plotdevice(-app|/run/console)\.py$', called_from))
14-
in_setup = bool(sys.modules['__main__'].__file__.endswith('setup.py'))
14+
in_setup = bool(called_from.endswith('setup.py'))
1515

1616
# add the Extras directory to sys.path since every module depends on PyObjC and friends
1717
try:

0 commit comments

Comments
 (0)