summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2023-02-03 07:47:18 +0100
committerGeorg Brandl <georg@python.org>2023-02-03 08:06:29 +0100
commitfe42aaca7b000200ea9915c04c01f2fb3f4dbaf6 (patch)
tree17244df3f44d0978c40cd01a1406a41a74cc48c1 /tests
parentc9ca87f08531e2695543112589d4461e31d52546 (diff)
downloadpygments-git-fe42aaca7b000200ea9915c04c01f2fb3f4dbaf6.tar.gz
Python console: make traceback handling more robust
Fixes #2329 Fixes #2226
Diffstat (limited to 'tests')
-rw-r--r--tests/snippets/pycon/broken_tb.txt97
1 files changed, 97 insertions, 0 deletions
diff --git a/tests/snippets/pycon/broken_tb.txt b/tests/snippets/pycon/broken_tb.txt
new file mode 100644
index 00000000..6cecf761
--- /dev/null
+++ b/tests/snippets/pycon/broken_tb.txt
@@ -0,0 +1,97 @@
+---input---
+>>> exec('"')
+Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ File "<string>", line 1
+ "
+ ^
+SyntaxError: EOL while scanning string literal
+
+>>> exec('"')
+Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ File "<string>", line 1, in <module>
+ "
+ ^
+SyntaxError: EOL while scanning string literal
+
+---tokens---
+'>>> ' Generic.Prompt
+'exec' Name
+'(' Punctuation
+"'" Literal.String.Single
+'"' Literal.String.Single
+"'" Literal.String.Single
+')' Punctuation
+'\n' Text.Whitespace
+
+'Traceback (most recent call last):\n' Generic.Traceback
+
+' File ' Text
+'"<stdin>"' Name.Builtin
+', line ' Text
+'1' Literal.Number
+', in ' Text
+'<module>' Name
+'\n' Text.Whitespace
+
+' File ' Text
+'"<string>"' Name.Builtin
+', line ' Text
+'1' Literal.Number
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'"' Literal.String.Double
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'^' Punctuation.Marker
+'\n' Text.Whitespace
+
+'SyntaxError' Generic.Error
+': ' Text
+'EOL while scanning string literal' Name
+'\n' Text.Whitespace
+
+'\n' Generic.Output
+
+'>>> ' Generic.Prompt
+'exec' Name
+'(' Punctuation
+"'" Literal.String.Single
+'"' Literal.String.Single
+"'" Literal.String.Single
+')' Punctuation
+'\n' Text.Whitespace
+
+'Traceback (most recent call last):\n' Generic.Traceback
+
+' File ' Text
+'"<stdin>"' Name.Builtin
+', line ' Text
+'1' Literal.Number
+', in ' Text
+'<module>' Name
+'\n' Text.Whitespace
+
+' File ' Text
+'"<string>"' Name.Builtin
+', line ' Text
+'1' Literal.Number
+', in ' Text
+'<module>' Name
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'"' Literal.String.Double
+'\n' Text.Whitespace
+
+' ' Text.Whitespace
+'^' Punctuation.Marker
+'\n' Text.Whitespace
+
+'SyntaxError' Generic.Error
+': ' Text
+'EOL while scanning string literal' Name
+'\n' Text.Whitespace