Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
Whoa now, don't *always* do this--only when we're actually running se…
Browse files Browse the repository at this point in the history
…tup.py
  • Loading branch information
embray committed Sep 23, 2015
1 parent 2f58cbe commit 7c427d8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions astropy_helpers/__init__.py
Expand Up @@ -37,8 +37,11 @@

# Ensure that all module-level code in astropy or other packages know that
# we're in setup mode:
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
builtins._ASTROPY_SETUP_ = True
if ('__main__' in sys.modules and
hasattr(sys.modules['__main__'], '__file__') and
sys.modules['__main__'].__file__.startswith('setup.py')):
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
builtins._ASTROPY_SETUP_ = True

0 comments on commit 7c427d8

Please sign in to comment.