mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-06 12:54:29 +08:00
Some more small Python 3 changes
This commit is contained in:
@@ -62,9 +62,8 @@ _VERSION_TAG = '%s-%s%s-%s' % (
|
|||||||
"""
|
"""
|
||||||
Short name for distinguish Python implementations and versions.
|
Short name for distinguish Python implementations and versions.
|
||||||
|
|
||||||
It's like `sys.implementation.cache_tag` but for Python2
|
It's a bit similar to `sys.implementation.cache_tag`.
|
||||||
we generate something similar. See:
|
See: http://docs.python.org/3/library/sys.html#sys.implementation
|
||||||
http://docs.python.org/3/library/sys.html#sys.implementation
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -117,10 +117,7 @@ def _get_actual_exception(code):
|
|||||||
assert False, "The piece of code should raise an exception."
|
assert False, "The piece of code should raise an exception."
|
||||||
|
|
||||||
# SyntaxError
|
# SyntaxError
|
||||||
if wanted == 'SyntaxError: non-keyword arg after keyword arg':
|
if wanted == 'SyntaxError: assignment to keyword':
|
||||||
# The python 3.5+ way, a bit nicer.
|
|
||||||
wanted = 'SyntaxError: positional argument follows keyword argument'
|
|
||||||
elif wanted == 'SyntaxError: assignment to keyword':
|
|
||||||
return [wanted, "SyntaxError: can't assign to keyword",
|
return [wanted, "SyntaxError: can't assign to keyword",
|
||||||
'SyntaxError: cannot assign to __debug__'], line_nr
|
'SyntaxError: cannot assign to __debug__'], line_nr
|
||||||
elif wanted == 'SyntaxError: f-string: unterminated string':
|
elif wanted == 'SyntaxError: f-string: unterminated string':
|
||||||
|
|||||||
Reference in New Issue
Block a user