mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Remove Python 1.x or 2.x compatibility code.
This commit is contained in:
parent
c4a55fccab
commit
01e4d57b0f
2 changed files with 3 additions and 12 deletions
|
@ -1559,17 +1559,8 @@ def shutdown(handlerList=_handlerList):
|
|||
#else, swallow
|
||||
|
||||
#Let's try and shutdown automatically on application exit...
|
||||
try:
|
||||
import atexit
|
||||
atexit.register(shutdown)
|
||||
except ImportError: # for Python versions < 2.0
|
||||
def exithook(status, old_exit=sys.exit):
|
||||
try:
|
||||
shutdown()
|
||||
finally:
|
||||
old_exit(status)
|
||||
|
||||
sys.exit = exithook
|
||||
import atexit
|
||||
atexit.register(shutdown)
|
||||
|
||||
# Null handler
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue