Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c59dacd

Browse files
committed
Fix a poorly-translated raise statement in contextlib.
1 parent 1966f1c commit c59dacd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/contextlib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def nested(*managers):
125125
# Don't rely on sys.exc_info() still containing
126126
# the right information. Another exception may
127127
# have been raised and caught by an exit method
128-
raise exc[0](exc[1]).with_traceback(exc[2])
128+
# exc[1] already has the __traceback__ attribute populated
129+
raise exc[1]
129130

130131

131132
class closing(object):

0 commit comments

Comments
 (0)