diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-08-16 16:11:03 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-08-16 16:11:03 (GMT) |
commit | 0067bd68c979e88b96e8eb5001d0e184ea949bb0 (patch) | |
tree | c15748690621cfb43a977137ab5f4e39d86c3de3 /Lib/test/test_exceptions.py | |
parent | 72dc1eadd918dc9ddd6a30149d90617d706a0b19 (diff) | |
download | cpython-0067bd68c979e88b96e8eb5001d0e184ea949bb0.zip cpython-0067bd68c979e88b96e8eb5001d0e184ea949bb0.tar.gz cpython-0067bd68c979e88b96e8eb5001d0e184ea949bb0.tar.bz2 |
add _testcapi.raise_memoryerror to make test_exceptions.test_MemoryError simpler
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r-- | Lib/test/test_exceptions.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 95c2dd1..5ce76f1 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -593,9 +593,10 @@ class ExceptionTests(unittest.TestCase): # PyErr_NoMemory always raises the same exception instance. # Check that the traceback is not doubled. import traceback + from _testcapi import raise_memoryerror def raiseMemError(): try: - "a" * (sys.maxsize // 2) + raise_memoryerror() except MemoryError as e: tb = e.__traceback__ else: |