diff options
| author | Benoit Pierre <benoit.pierre@gmail.com> | 2018-01-25 10:27:04 +0100 |
|---|---|---|
| committer | Benoit Pierre <benoit.pierre@gmail.com> | 2018-01-25 10:28:46 +0100 |
| commit | 7bf15cb3c8a29545cc4869a4a1c52ac678eba1da (patch) | |
| tree | aeeafbf8e554a46b7ecdaf8cdc25a3fd5c4e3fb8 /setuptools | |
| parent | 618312bec376e5c71b0938a754106973d8889417 (diff) | |
| download | python-setuptools-git-7bf15cb3c8a29545cc4869a4a1c52ac678eba1da.tar.gz | |
fix Python 3.7 support
- update scanning code to handle pyc header change
- handle change to `Exception.__repr__` output
Diffstat (limited to 'setuptools')
| -rw-r--r-- | setuptools/command/bdist_egg.py | 4 | ||||
| -rw-r--r-- | setuptools/tests/test_sandbox.py | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 5fdb62d9..d222c208 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -409,8 +409,10 @@ def scan_module(egg_dir, base, name, stubs): module = pkg + (pkg and '.' or '') + os.path.splitext(name)[0] if sys.version_info < (3, 3): skip = 8 # skip magic & date - else: + elif sys.version_info < (3, 7): skip = 12 # skip magic & date & file size + else: + skip = 16 # skip magic & reserved? & date & file size f = open(filename, 'rb') f.read(skip) code = marshal.load(f) diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py index a3f1206d..d8675422 100644 --- a/setuptools/tests/test_sandbox.py +++ b/setuptools/tests/test_sandbox.py @@ -75,6 +75,8 @@ class TestExceptionSaver: def test_unpickleable_exception(self): class CantPickleThis(Exception): "This Exception is unpickleable because it's not in globals" + def __repr__(self): + return 'CantPickleThis%r' % (self.args,) with setuptools.sandbox.ExceptionSaver() as saved_exc: raise CantPickleThis('detail') |
