diff options
author | Tarek Ziade <tarek@ziade.org> | 2010-05-06 16:50:18 +0200 |
---|---|---|
committer | Tarek Ziade <tarek@ziade.org> | 2010-05-06 16:50:18 +0200 |
commit | 3a9c591f47b69048b513e5654e5d98efe3f2365a (patch) | |
tree | 06faaaea0aa7d00a972f45709bf872c60336413a /setuptools/__init__.py | |
parent | b53fad8a9e4e807564d11db3ed5a75187e3e1f6c (diff) | |
download | external_python_setuptools-3a9c591f47b69048b513e5654e5d98efe3f2365a.tar.gz external_python_setuptools-3a9c591f47b69048b513e5654e5d98efe3f2365a.tar.bz2 external_python_setuptools-3a9c591f47b69048b513e5654e5d98efe3f2365a.zip |
respect the sys.dont_write_bytecode flag. Fixes #1470.6.11
--HG--
branch : distribute
extra : rebase_source : 889c1badc92b1de14352a141865172b0a39384fa
Diffstat (limited to 'setuptools/__init__.py')
-rw-r--r-- | setuptools/__init__.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/setuptools/__init__.py b/setuptools/__init__.py index c8a631a0..9de373f9 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -5,7 +5,8 @@ import distutils.core, setuptools.command from setuptools.depends import Require from distutils.core import Command as _Command from distutils.util import convert_path -import os.path +import os +import sys __version__ = '0.6' __all__ = [ @@ -95,4 +96,9 @@ def findall(dir = os.curdir): import distutils.filelist 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 |