mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +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
16
third_party/python/Lib/test/test_copy.py
vendored
16
third_party/python/Lib/test/test_copy.py
vendored
|
@ -1,5 +1,6 @@
|
|||
"""Unit tests for the copy module."""
|
||||
|
||||
import cosmo
|
||||
import copy
|
||||
import copyreg
|
||||
import weakref
|
||||
|
@ -372,8 +373,9 @@ class TestCopy(unittest.TestCase):
|
|||
x = []
|
||||
x.append(x)
|
||||
y = copy.deepcopy(x)
|
||||
for op in comparisons:
|
||||
self.assertRaises(RecursionError, op, y, x)
|
||||
if cosmo.MODE == "dbg": # requires recursion checking
|
||||
for op in comparisons:
|
||||
self.assertRaises(RecursionError, op, y, x)
|
||||
self.assertIsNot(y, x)
|
||||
self.assertIs(y[0], y)
|
||||
self.assertEqual(len(y), 1)
|
||||
|
@ -399,8 +401,9 @@ class TestCopy(unittest.TestCase):
|
|||
x = ([],)
|
||||
x[0].append(x)
|
||||
y = copy.deepcopy(x)
|
||||
for op in comparisons:
|
||||
self.assertRaises(RecursionError, op, y, x)
|
||||
if cosmo.MODE == "dbg": # requires recursion checking
|
||||
for op in comparisons:
|
||||
self.assertRaises(RecursionError, op, y, x)
|
||||
self.assertIsNot(y, x)
|
||||
self.assertIsNot(y[0], x[0])
|
||||
self.assertIs(y[0][0], y)
|
||||
|
@ -418,8 +421,9 @@ class TestCopy(unittest.TestCase):
|
|||
y = copy.deepcopy(x)
|
||||
for op in order_comparisons:
|
||||
self.assertRaises(TypeError, op, y, x)
|
||||
for op in equality_comparisons:
|
||||
self.assertRaises(RecursionError, op, y, x)
|
||||
if cosmo.MODE == "dbg": # requires recursion checking
|
||||
for op in equality_comparisons:
|
||||
self.assertRaises(RecursionError, op, y, x)
|
||||
self.assertIsNot(y, x)
|
||||
self.assertIs(y['foo'], y)
|
||||
self.assertEqual(len(y), 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue