summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/try-as-var.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/try-as-var.py')
-rw-r--r--tests/basics/try-as-var.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/basics/try-as-var.py b/tests/basics/try-as-var.py
new file mode 100644
index 0000000000..0a92f1caee
--- /dev/null
+++ b/tests/basics/try-as-var.py
@@ -0,0 +1,10 @@
+try:
+ raise ValueError(534)
+except ValueError as e:
+ print(repr(e))
+
+# Var bound in except block is automatically deleted
+try:
+ e
+except NameError:
+ print("NameError")