exception elements are always instances

This commit is contained in:
Dave Halter
2014-06-22 16:25:42 +02:00
parent 3e0f719915
commit 401914e91c
2 changed files with 24 additions and 2 deletions

View File

@@ -332,6 +332,17 @@ except ImportError, i_b:
#? ImportError()
i_b
class MyException(Exception):
def __init__(self, my_attr):
self.my_attr = my_attr
try:
raise MyException(1)
except MyException as e:
#? ['my_attr']
e.my_attr
# -----------------
# continuations
# -----------------