mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Fix Pyston speedups (#281)
We remove (i.e. hide behind a debug ifdef) the recursion checking methods, and the memory hooks and memory allocator methods. ASAN mode has no PYMALLOC, so we need a macro. Fix build break with des.c stack allocation.
This commit is contained in:
parent
2fe8571010
commit
57f0eed382
42 changed files with 260 additions and 63 deletions
18
third_party/python/Lib/test/test_functools.py
vendored
18
third_party/python/Lib/test/test_functools.py
vendored
|
@ -217,6 +217,7 @@ class TestPartial:
|
|||
[f'{name}({capture!r}, {args_repr}, {kwargs_repr})'
|
||||
for kwargs_repr in kwargs_reprs])
|
||||
|
||||
@unittest.skipUnless(cosmo.MODE == "dbg", "disabled recursion checking")
|
||||
def test_recursive_repr(self):
|
||||
if self.partial in (c_functools.partial, py_functools.partial):
|
||||
name = 'functools.partial'
|
||||
|
@ -329,14 +330,15 @@ class TestPartial:
|
|||
|
||||
def test_recursive_pickle(self):
|
||||
with self.AllowPickle():
|
||||
f = self.partial(capture)
|
||||
f.__setstate__((f, (), {}, {}))
|
||||
try:
|
||||
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
|
||||
with self.assertRaises(RecursionError):
|
||||
pickle.dumps(f, proto)
|
||||
finally:
|
||||
f.__setstate__((capture, (), {}, {}))
|
||||
if cosmo.MODE == "dbg":
|
||||
f = self.partial(capture)
|
||||
f.__setstate__((f, (), {}, {}))
|
||||
try:
|
||||
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
|
||||
with self.assertRaises(RecursionError):
|
||||
pickle.dumps(f, proto)
|
||||
finally:
|
||||
f.__setstate__((capture, (), {}, {}))
|
||||
|
||||
f = self.partial(capture)
|
||||
f.__setstate__((capture, (f,), {}, {}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue