diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2013-06-19 15:11:01 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-06-19 15:11:01 -0500 |
| commit | 1f98cb2880de5d716933ada52604044cbe5b3cbc (patch) | |
| tree | 468d8b819af1ef8c90304ef65fba985b85487c1e /setuptools/command | |
| parent | 48b0d2bfbd4aee6cc34ae6656d7c7033298f5ac0 (diff) | |
| parent | 1c5400fd8216c101b7d120e1b079e46add869ade (diff) | |
| download | python-setuptools-git-1f98cb2880de5d716933ada52604044cbe5b3cbc.tar.gz | |
Merged in vinay.sajip/setuptools/single-codebase (pull request #5)
Additional changes relating to single codebase support
Diffstat (limited to 'setuptools/command')
| -rwxr-xr-x | setuptools/command/easy_install.py | 7 | ||||
| -rw-r--r-- | setuptools/command/test.py | 2 | ||||
| -rw-r--r-- | setuptools/command/upload_docs.py | 12 |
3 files changed, 16 insertions, 5 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 731a4dc3..3194644e 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -58,7 +58,10 @@ from pkg_resources import yield_lines, normalize_path, resource_string, \ DistributionNotFound, VersionConflict, \ DEVELOP_DIST -sys_executable = os.path.normpath(sys.executable) +if '__VENV_LAUNCHER__' in os.environ: + sys_executable = os.environ['__VENV_LAUNCHER__'] +else: + sys_executable = os.path.normpath(sys.executable) __all__ = [ 'samefile', 'easy_install', 'PthDistributions', 'extract_wininst_cfg', @@ -282,6 +285,8 @@ class easy_install(Command): self.script_dir = self.install_scripts # default --record from the install command self.set_undefined_options('install', ('record', 'record')) + # Should this be moved to the if statement below? It's not used + # elsewhere normpath = map(normalize_path, sys.path) self.all_site_dirs = get_site_dirs() if self.site_dirs is not None: diff --git a/setuptools/command/test.py b/setuptools/command/test.py index a02ac142..db2fc7b1 100644 --- a/setuptools/command/test.py +++ b/setuptools/command/test.py @@ -154,7 +154,7 @@ class test(Command): for name in sys.modules: if name.startswith(module): del_modules.append(name) - map(sys.modules.__delitem__, del_modules) + list(map(sys.modules.__delitem__, del_modules)) loader_ep = EntryPoint.parse("x="+self.test_loader) loader_class = loader_ep.load(require=False) diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py index a75c3b7e..12bc916b 100644 --- a/setuptools/command/upload_docs.py +++ b/setuptools/command/upload_docs.py @@ -23,15 +23,21 @@ try: except ImportError: from setuptools.command.upload import upload -from setuptools.compat import httplib, urlparse +from setuptools.compat import httplib, urlparse, unicode, iteritems _IS_PYTHON3 = sys.version > '3' +if _IS_PYTHON3: + errors = 'surrogateescape' +else: + errors = 'strict' + + # This is not just a replacement for byte literals # but works as a general purpose encoder def b(s, encoding='utf-8'): if isinstance(s, unicode): - return s.encode(encoding) + return s.encode(encoding, errors) return s @@ -127,7 +133,7 @@ class upload_docs(upload): sep_boundary = b('\n--') + b(boundary) end_boundary = sep_boundary + b('--') body = [] - for key, values in data.iteritems(): + for key, values in iteritems(data): title = '\nContent-Disposition: form-data; name="%s"' % key # handle multiple entries for the same name if type(values) != type([]): |
