From 6c6f4caa4bacce4b719b1e03fb02fdb857b1a135 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 18 Dec 2016 10:07:11 -0500 Subject: Move toward future compatibility using unicode strings, but cast to native str as workaround for #709, #710, and #712. --- setuptools/command/easy_install.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'setuptools/command') 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: -- cgit v1.2.1