diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-12-18 10:07:11 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-12-18 10:07:11 -0500 |
commit | 6c6f4caa4bacce4b719b1e03fb02fdb857b1a135 (patch) | |
tree | 45cb4fef5c3b3a20712d31b068e84b856236c066 | |
parent | 674d5ecb1695de056226d1ad65c5d8b48ca99f3b (diff) | |
download | external_python_setuptools-6c6f4caa4bacce4b719b1e03fb02fdb857b1a135.tar.gz external_python_setuptools-6c6f4caa4bacce4b719b1e03fb02fdb857b1a135.tar.bz2 external_python_setuptools-6c6f4caa4bacce4b719b1e03fb02fdb857b1a135.zip |
Move toward future compatibility using unicode strings, but cast to native str as workaround for #709, #710, and #712.
-rwxr-xr-x | setuptools/command/easy_install.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index b9d41cb0..14ad25c2 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -629,16 +629,12 @@ class easy_install(Command): @contextlib.contextmanager def _tmpdir(self): - tmpdir = tempfile.mkdtemp(prefix="easy_install-") + tmpdir = tempfile.mkdtemp(prefix=six.u("easy_install-")) try: - yield tmpdir + # cast to str as workaround for #709 and #710 and #712 + yield str(tmpdir) finally: - if not os.path.exists(tmpdir): - return - # workaround for http://bugs.python.org/issue24672 - if six.PY2: - tmpdir = tmpdir.decode('ascii') - rmtree(tmpdir) + os.path.exists(tmpdir) and rmtree(tmpdir) def easy_install(self, spec, deps=False): if not self.editable: |