Skip to content

Commit f77a7d9

Browse files
authored
Merge pull request #1380 from minrk/close_handlers
call close_handlers before garbage collection
2 parents 8a6eb6b + 4b33d0f commit f77a7d9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

repo2docker/__main__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,15 @@ def main():
482482
if r2d.log_level == logging.DEBUG:
483483
r2d.log.exception(e)
484484
sys.exit(1)
485+
finally:
486+
# workaround bug in traitlets Application.__del__:
487+
# https://github.com/ipython/traitlets/pull/912
488+
# make sure close_handlers is called before process teardown
489+
try:
490+
r2d.close_handlers()
491+
except AttributeError:
492+
# traitlets < 5.10
493+
pass
485494

486495

487496
if __name__ == "__main__":

0 commit comments

Comments
 (0)