aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-09-02 14:12:15 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-09-02 14:12:15 -0400
commit420493f6338b6511cddb6b6bcafcdb33415afe4b (patch)
treead55791c01329db01872040dc0e4b7836efe019c
parent352f5f5c49dbd9d0a71106b7d380adce2543d020 (diff)
downloadexternal_python_setuptools-420493f6338b6511cddb6b6bcafcdb33415afe4b.tar.gz
external_python_setuptools-420493f6338b6511cddb6b6bcafcdb33415afe4b.tar.bz2
external_python_setuptools-420493f6338b6511cddb6b6bcafcdb33415afe4b.zip
More simply resolve _dont_write_bytecode.
-rw-r--r--setuptools/__init__.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/setuptools/__init__.py b/setuptools/__init__.py
index 48bc1a4b..fc9b7b93 100644
--- a/setuptools/__init__.py
+++ b/setuptools/__init__.py
@@ -94,10 +94,5 @@ def findall(dir = os.curdir):
distutils.filelist.findall = findall # fix findall bug in distutils.
# sys.dont_write_bytecode was introduced in Python 2.6.
-_dont_write_bytecode = (
- (hasattr(sys, "dont_write_bytecode") and sys.dont_write_bytecode)
- or (
- not hasattr(sys, "dont_write_bytecode")
- and os.environ.get("PYTHONDONTWRITEBYTECODE")
- )
-)
+_dont_write_bytecode = getattr(sys, 'dont_write_bytecode',
+ bool(os.environ.get("PYTHONDONTWRITEBYTECODE")))