diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-08-16 00:29:24 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-08-16 07:15:18 -0400 |
commit | fb7ab81a3d080422687bad71f9ae9d36eeefbee2 (patch) | |
tree | d87a9f6fdf32ab64334e1eb8a695949a88a3b043 /setuptools/sandbox.py | |
parent | 4eb5b32f8d8bb1e20907028a516346e2b1901391 (diff) | |
download | python-setuptools-git-fb7ab81a3d080422687bad71f9ae9d36eeefbee2.tar.gz |
Remove Python 2 compatibility
Diffstat (limited to 'setuptools/sandbox.py')
-rw-r--r-- | setuptools/sandbox.py | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index 24a36080..91b960d8 100644 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -8,9 +8,7 @@ import re import contextlib import pickle import textwrap - -from setuptools.extern import six -from setuptools.extern.six.moves import builtins, map +import builtins import pkg_resources from distutils.errors import DistutilsError @@ -138,7 +136,7 @@ class ExceptionSaver: return type, exc = map(pickle.loads, self._saved) - six.reraise(type, exc, self._tb) + raise exc.with_traceback(self._tb) @contextlib.contextmanager @@ -251,15 +249,8 @@ def run_setup(setup_script, args): working_set.__init__() working_set.callbacks.append(lambda dist: dist.activate()) - # __file__ should be a byte string on Python 2 (#712) - dunder_file = ( - setup_script - if isinstance(setup_script, str) else - setup_script.encode(sys.getfilesystemencoding()) - ) - with DirectorySandbox(setup_dir): - ns = dict(__file__=dunder_file, __name__='__main__') + ns = dict(__file__=setup_script, __name__='__main__') _execfile(setup_script, ns) except SystemExit as v: if v.args and v.args[0]: |