diff options
author | Guido van Rossum <guido@python.org> | 1995-03-04 22:30:54 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-03-04 22:30:54 (GMT) |
commit | 51b1c1c145ca818356f7857ed98203bcf166043f (patch) | |
tree | db281cdc9100912e8018f9bd0c28507d139dddd9 /Lib/test/test_b1.py | |
parent | 1dba24eecadc76e682745ecb5fecf7f49b0811cc (diff) | |
download | cpython-51b1c1c145ca818356f7857ed98203bcf166043f.zip cpython-51b1c1c145ca818356f7857ed98203bcf166043f.tar.gz cpython-51b1c1c145ca818356f7857ed98203bcf166043f.tar.bz2 |
avoid math, don't abort when overflow check fails
Diffstat (limited to 'Lib/test/test_b1.py')
-rw-r--r-- | Lib/test/test_b1.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_b1.py b/Lib/test/test_b1.py index f0a6bd6..903cc56 100644 --- a/Lib/test/test_b1.py +++ b/Lib/test/test_b1.py @@ -224,7 +224,11 @@ if map(None, range(10)) <> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]: raise TestFailed, 'map(None, range(10))' if map(lambda x: x*x, range(1,4)) <> [1, 4, 9]: raise TestFailed, 'map(lambda x: x*x, range(1,4))' -from math import sqrt +try: + from math import sqrt +except ImportError: + def sqrt(x): + return pow(x, 0.5) if map(lambda x: map(sqrt,x), [[16, 4], [81, 9]]) <> [[4.0, 2.0], [9.0, 3.0]]: raise TestFailed, 'map(lambda x: map(sqrt,x), [[16, 4], [81, 9]])' if map(lambda x, y: x+y, [1,3,2], [9,1,4]) <> [10, 4, 6]: |