handles exceptions in containment callbacks
This commit is contained in:
parent
e6652b6783
commit
e699be5c6d
3 changed files with 10 additions and 3 deletions
|
@ -813,6 +813,12 @@ class Main:
|
||||||
|
|
||||||
for i, (cb, ctx) in enumerate(self.uncontained_exception_callbacks):
|
for i, (cb, ctx) in enumerate(self.uncontained_exception_callbacks):
|
||||||
self.print("(%d/%d) %s" %(i+1, l, cb.__name__))
|
self.print("(%d/%d) %s" %(i+1, l, cb.__name__))
|
||||||
|
try:
|
||||||
cb(*ctx)
|
cb(*ctx)
|
||||||
|
except Exception as e:
|
||||||
|
self.print("(%d/%d) <r>%s failed<.> (<R>%s<.>)" %(i+1, l, cb.__name__, e.__class__.__name__), self.print.tl.epic, end=":\n")
|
||||||
|
exc_info = sys.exc_info()
|
||||||
|
traceback.print_exception(*exc_info)
|
||||||
|
del exc_info
|
||||||
|
|
||||||
self.print("containment callbacks executed", self.print.tl.done)
|
self.print("containment callbacks executed", self.print.tl.done)
|
||||||
|
|
|
@ -46,6 +46,7 @@ def context_dir(path):
|
||||||
"""
|
"""
|
||||||
A directory context manager.
|
A directory context manager.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
previous = os.getcwd()
|
previous = os.getcwd()
|
||||||
os.chdir(path)
|
os.chdir(path)
|
||||||
|
|
||||||
|
|
|
@ -4,5 +4,5 @@
|
||||||
major = 1 # VERSION_MAJOR_IDENTIFIER
|
major = 1 # VERSION_MAJOR_IDENTIFIER
|
||||||
minor = 101 # VERSION_MINOR_IDENTIFIER
|
minor = 101 # VERSION_MINOR_IDENTIFIER
|
||||||
# VERSION_LAST_MM 1.101
|
# VERSION_LAST_MM 1.101
|
||||||
patch = 0 # VERSION_PATCH_IDENTIFIER
|
patch = 1 # VERSION_PATCH_IDENTIFIER
|
||||||
str = "1.101.0" # VERSION_STRING_IDENTIFIER
|
str = "1.101.1" # VERSION_STRING_IDENTIFIER
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue