summaryrefslogtreecommitdiff
path: root/tests/basics/python34.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-08-17 15:46:04 +1000
committerJeff Epler <jepler@gmail.com>2020-03-31 17:27:10 -0500
commit8f0147cf00e3fa8db283adbd1698c60fbe76a62a (patch)
tree8b18083264697e79598863acb09811eab3a913d6 /tests/basics/python34.py
parent4c4f81f8f2f68a5dc47d37ba185a2506224d7159 (diff)
tests: Modify tests that print repr of an exception with 1 arg.
In Python 3.7 the behaviour of repr() of an exception with one argument changed: it no longer prints a trailing comma in the argument list. See https://bugs.python.org/issue30399 This patch modifies tests that rely on this behaviour to not rely on it. And the python34.py test is updated to include a test for this behaviour with a .exp file.
Diffstat (limited to 'tests/basics/python34.py')
-rw-r--r--tests/basics/python34.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/basics/python34.py b/tests/basics/python34.py
index 36531f11c..4030db143 100644
--- a/tests/basics/python34.py
+++ b/tests/basics/python34.py
@@ -1,4 +1,4 @@
-# tests that differ when running under Python 3.4 vs 3.5/3.6
+# tests that differ when running under Python 3.4 vs 3.5/3.6/3.7
try:
exec
@@ -36,3 +36,7 @@ test_syntax("del ()") # can't delete empty tuple (in 3.6 we can)
import sys
print(sys.version[:3])
print(sys.version_info[0], sys.version_info[1])
+
+# from basics/exception1.py
+# in 3.7 no comma is printed if there is only 1 arg (in 3.4-3.6 one is printed)
+print(repr(IndexError("foo")))