mirror of
https://github.com/davidhalter/parso.git
synced 2026-10-15 02:31:08 +08:00
Get escaping issues working in all versions.
This commit is contained in:
1 parent
3ccbf4326c
commit
d6b6354e17
2 files changed
+14
-2
No files matched your search
@@ -306,6 +306,11 @@ def _get_actual_exception(code):
|
||||
except (SyntaxError, IndentationError) as e:
|
||||
wanted = e.__class__.__name__ + ': ' + e.msg
|
||||
line_nr = e.lineno
|
||||
except ValueError as e:
|
||||
# The ValueError comes from byte literals in Python 2 like '\x'
|
||||
# that are oddly enough not SyntaxErrors.
|
||||
wanted = 'SyntaxError: (value error) ' + str(e)
|
||||
line_nr = None
|
||||
else:
|
||||
assert False, "The piece of code should raise an exception."
|
||||
|
||||
|
||||
Reference in new issue
Block a user