aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-08-25 02:14:08 +0000
committerTim Peters <tim.peters@gmail.com>2004-08-25 02:14:08 +0000
commitc8854434790d3a281f0ea5a4714e5c01414413b0 (patch)
treef6edfa8738087c52d1fb4e077bba738f2f42cd49 /Lib/test/test_exceptions.py
parent1fa040ba73db700debd9f5079fa2083a0937f8b6 (diff)
downloadcpython-c8854434790d3a281f0ea5a4714e5c01414413b0.tar.gz
cpython-c8854434790d3a281f0ea5a4714e5c01414413b0.zip
Stop producing or using OverflowWarning. PEP 237 thought this would
happen in 2.3, but nobody noticed it still was getting generated (the warning was disabled by default). OverflowWarning and PyExc_OverflowWarning should be removed for 2.5, and left notes all over saying so.
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 83e680f81a8..c157122b5b0 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -85,15 +85,16 @@ except NameError: pass
r(OverflowError)
# XXX
-# Obscure: this test relies on int+int raising OverflowError if the
-# ints are big enough. But ints no longer do that by default. This
-# test will have to go away someday. For now, we can convert the
-# transitional OverflowWarning into an error.
+# Obscure: in 2.2 and 2.3, this test relied on changing OverflowWarning
+# into an error, in order to trigger OverflowError. In 2.4, OverflowWarning
+# should no longer be generated, so the focus of the test shifts to showing
+# that OverflowError *isn't* generated. OverflowWarning should be gone
+# in Python 2.5, and then the filterwarnings() call, and this comment,
+# should go away.
warnings.filterwarnings("error", "", OverflowWarning, __name__)
x = 1
-try:
- while 1: x = x+x
-except OverflowError: pass
+for dummy in range(128):
+ x += x # this simply shouldn't blow up
r(RuntimeError)
print '(not used any more?)'