Skip to content

Commit 278fc8b

Browse files
committed
Change example code
1 parent 08f7892 commit 278fc8b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/user-guide.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,14 @@ protect those code object, add extra decorator at the begin:
600600
func.__refcalls__ = 0
601601
def wrapper(*args, **kwargs):
602602
__wraparmor__(func)
603+
tb = None
603604
try:
604605
return func(*args, **kwargs)
605-
except Exception as err:
606-
raise err
606+
except Exception:
607+
tb = sys.exc_info()[2]
608+
raise
607609
finally:
608-
__wraparmor__(func, 1)
610+
__wraparmor__(func, tb, 1)
609611
wrapper.__module__ = func.__module__
610612
wrapper.__name__ = func.__name__
611613
wrapper.__doc__ = func.__doc__

0 commit comments

Comments
 (0)