This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Recognize a connection error from an exception object. | |
| Blog post: | |
| https://gmpy.dev/blog/2023/recognize-connection-errors | |
| Author: Giampaolo Rodola | |
| License: MIT | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| People erroneously think that any function registered via atexit.register() | |
| will be executed on interpreter exit. | |
| This is not always true. For example, in case of SIGTERM: | |
| import atexit, os, signal | |
| @atexit.register | |
| def cleanup(): | |
| print("on exit") # XXX this never gets printed |