Commit 352f5f5c authored by Jason R. Coombs's avatar Jason R. Coombs

Refactor _dont_write_bytecode detection

parent 26ea618c
......@@ -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")
)
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment