File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -72,3 +72,61 @@ def print_exc_info(e, chain=True):
72
72
print_exc_info (e , chain = False )
73
73
print_exc_info (e )
74
74
print ()
75
+
76
+ class SomeException (RuntimeError ):
77
+ pass
78
+
79
+ try :
80
+ try :
81
+ raise Exception ("inner" )
82
+ except Exception as inner :
83
+ raise SomeException ("outer" ) from inner
84
+ except Exception as e :
85
+ print_exc_info (e )
86
+
87
+ try :
88
+ try :
89
+ raise Exception ("inner" )
90
+ except Exception as inner :
91
+ l = inner
92
+ raise SomeException ("outer" ) from l
93
+ except Exception as e :
94
+ print_exc_info (e )
95
+ print ()
96
+
97
+ try :
98
+ try :
99
+ raise SomeException ("inner" )
100
+ except Exception as inner :
101
+ raise Exception ("outer" ) from inner
102
+ except Exception as e :
103
+ print_exc_info (e )
104
+
105
+ try :
106
+ try :
107
+ raise SomeException ("inner" )
108
+ except Exception as inner :
109
+ l = inner
110
+ raise Exception ("outer" ) from l
111
+ except Exception as e :
112
+ print (e , e .__cause__ , e .__context__ )
113
+ pri
9EA0
nt_exc_info (e )
114
+ print ()
115
+
116
+ try :
117
+ try :
118
+ raise SomeException ("inner" )
119
+ except Exception as inner :
120
+ raise SomeException ("outer" ) from inner
121
+ except Exception as e :
122
+ print_exc_info (e )
123
+
124
+ try :
125
+ try :
126
+ raise SomeException ("inner" )
127
+ except Exception as inner :
128
+ l = inner
129
+ raise SomeException ("outer" ) from l
130
+ except Exception as e :
131
+ print_exc_info (e )
132
+ print ()
You can’t perform that action at this time.
0 commit comments