zopefoundation / zope.exceptions

exceptions and implementations which are general purpose
https://zopeexceptions.readthedocs.io/
Other
0 stars 6 forks source link

More adaption to Python 3.10 syntax error message #23

Closed bnavigator closed 2 years ago

bnavigator commented 2 years ago

This is a follow up to #19. Note the varying position of the caret. I don't have pypy installed, but I suspect the comment is related.

$ 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
icemac commented 2 years ago

Thank you for this PR. 😃