aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--queries/python/highlights.scm2
-rw-r--r--tests/query/highlights/python/raise_from.py6
2 files changed, 8 insertions, 0 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index ec419375f..681b9e4de 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -240,6 +240,8 @@
"finally"
] @exception
+(raise_statement "from" @exception)
+
(try_statement
(else_clause
"else" @exception))
diff --git a/tests/query/highlights/python/raise_from.py b/tests/query/highlights/python/raise_from.py
new file mode 100644
index 000000000..8a48a222b
--- /dev/null
+++ b/tests/query/highlights/python/raise_from.py
@@ -0,0 +1,6 @@
+try:
+ print(1 / 0)
+except Exception:
+ raise RuntimeError from None
+ # ^ @exception
+ # ^ @exception