Commit fd7c43e7 authored by Antoine Pitrou's avatar Antoine Pitrou

#3556: test_raiseMemError consumes an insane amount of memory

parent bebb18be
......@@ -1118,14 +1118,9 @@ class UnicodeTest(
# when a string allocation fails with a MemoryError.
# This used to crash the interpreter,
# or leak references when the number was smaller.
try:
u"a" * (sys.maxint // 2 - 100)
except MemoryError:
pass
try:
u"a" * (sys.maxint // 2 - 100)
except MemoryError:
pass
alloc = lambda: u"a" * (sys.maxsize - 100)
self.assertRaises(MemoryError, alloc)
self.assertRaises(MemoryError, alloc)
def test_main():
test_support.run_unittest(__name__)
......
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