Skip to content

Commit

Permalink
More adaption to Python 3.10 syntax error message
Browse files Browse the repository at this point in the history
$ python2.7 -c 'syntax error'
  File "<string>", line 1
    syntax error
               ^
SyntaxError: invalid syntax
$ python3.6 -c 'syntax error'
  File "<string>", line 1
    syntax error
               ^
SyntaxError: invalid syntax
$ python3.8 -c 'syntax error'
  File "<string>", line 1
    syntax error
           ^
SyntaxError: invalid syntax
$ python3.9 -c 'syntax error'
  File "<string>", line 1
    syntax error
           ^
SyntaxError: invalid syntax
$ python3.10 -c 'syntax error'
  File "<string>", line 1
    syntax error
           ^^^^^
SyntaxError: invalid syntax
  • Loading branch information
bnavigator authored and Michael Howitz committed Feb 11, 2022
1 parent 49341f0 commit cb2d214
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/zope/exceptions/tests/test_exceptionformatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,7 @@ def test_multiline_exception(self):
s = self._callFUT(False)
lines = s.splitlines()[-3:]
self.assertEqual(lines[0], ' syntax error')
# PyPy has a shorter prefix
self.assertTrue(lines[1].endswith(' ^'))
self.assertIn(' ^', lines[1])
self.assertTrue(lines[2].startswith('SyntaxError: invalid syntax'),
lines[2])

Expand Down

0 comments on commit cb2d214

Please sign in to comment.