diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-09-02 14:04:53 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-09-02 14:04:53 -0400 |
commit | 352f5f5c49dbd9d0a71106b7d380adce2543d020 (patch) | |
tree | d45376e4dd111f32fd047f2eb98fa8c17b8dc117 /setuptools | |
parent | 26ea618c278baa8ea77bf3f81f8abf5e3c1cf416 (diff) | |
download | external_python_setuptools-352f5f5c49dbd9d0a71106b7d380adce2543d020.tar.gz external_python_setuptools-352f5f5c49dbd9d0a71106b7d380adce2543d020.tar.bz2 external_python_setuptools-352f5f5c49dbd9d0a71106b7d380adce2543d020.zip |
Refactor _dont_write_bytecode detection
Diffstat (limited to 'setuptools')
-rw-r--r-- | setuptools/__init__.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 820f7f55..48bc1a4b 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -94,8 +94,10 @@ def findall(dir = os.curdir): distutils.filelist.findall = findall # fix findall bug in distutils. # sys.dont_write_bytecode was introduced in Python 2.6. -if ((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 = True -else: - _dont_write_bytecode = False +_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") + ) +) |