Skip to content

Commit

Permalink
Merge pull request #1380 from minrk/close_handlers
Browse files Browse the repository at this point in the history
call close_handlers before garbage collection
  • Loading branch information
manics authored Nov 28, 2024
2 parents 8a6eb6b + 4b33d0f commit f77a7d9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions repo2docker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,15 @@ def main():
if r2d.log_level == logging.DEBUG:
r2d.log.exception(e)
sys.exit(1)
finally:
# workaround bug in traitlets Application.__del__:
# https://github.com/ipython/traitlets/pull/912
# make sure close_handlers is called before process teardown
try:
r2d.close_handlers()
except AttributeError:
# traitlets < 5.10
pass


if __name__ == "__main__":
Expand Down

0 comments on commit f77a7d9

Please sign in to comment.