Commit b9395665 authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #1263 from benoit-pierre/fix_python37_support

fix Python 3.7 support
parents 69c9a3aa 7bf15cb3
...@@ -409,8 +409,10 @@ def scan_module(egg_dir, base, name, stubs): ...@@ -409,8 +409,10 @@ def scan_module(egg_dir, base, name, stubs):
module = pkg + (pkg and '.' or '') + os.path.splitext(name)[0] module = pkg + (pkg and '.' or '') + os.path.splitext(name)[0]
if sys.version_info < (3, 3): if sys.version_info < (3, 3):
skip = 8 # skip magic & date skip = 8 # skip magic & date
else: elif sys.version_info < (3, 7):
skip = 12 # skip magic & date & file size skip = 12 # skip magic & date & file size
else:
skip = 16 # skip magic & reserved? & date & file size
f = open(filename, 'rb') f = open(filename, 'rb')
f.read(skip) f.read(skip)
code = marshal.load(f) code = marshal.load(f)
......
...@@ -75,6 +75,8 @@ class TestExceptionSaver: ...@@ -75,6 +75,8 @@ class TestExceptionSaver:
def test_unpickleable_exception(self): def test_unpickleable_exception(self):
class CantPickleThis(Exception): class CantPickleThis(Exception):
"This Exception is unpickleable because it's not in globals" "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: with setuptools.sandbox.ExceptionSaver() as saved_exc:
raise CantPickleThis('detail') raise CantPickleThis('detail')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment