Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def fn():
try:
a = 1 # noqa: F841
1/0
except ZeroDivisionError:
pdbpp.post_mortem(Pdb=PdbTest)
def fn():
def throws():
0 / 0
def f():
throws()
try:
f()
except:
pdbpp.post_mortem(Pdb=PdbTest)
check(fn, r"""
def fn():
def raises():
raise Exception("foo")
try:
raises()
except Exception:
tb = sys.exc_info()[2]
tb_ = tb
while tb_:
tb_.tb_frame.f_locals["__tracebackhide__"] = True
tb_ = tb_.tb_next
pdbpp.post_mortem(tb, Pdb=PdbTest)
return 1