Commit 01e4d57b authored by Georg Brandl's avatar Georg Brandl

Remove Python 1.x or 2.x compatibility code.

parent c4a55fcc
...@@ -1559,17 +1559,8 @@ def shutdown(handlerList=_handlerList): ...@@ -1559,17 +1559,8 @@ def shutdown(handlerList=_handlerList):
#else, swallow #else, swallow
#Let's try and shutdown automatically on application exit... #Let's try and shutdown automatically on application exit...
try: import atexit
import atexit atexit.register(shutdown)
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
# Null handler # Null handler
......
...@@ -65,7 +65,7 @@ def fileConfig(fname, defaults=None, disable_existing_loggers=True): ...@@ -65,7 +65,7 @@ def fileConfig(fname, defaults=None, disable_existing_loggers=True):
import configparser import configparser
cp = configparser.ConfigParser(defaults) cp = configparser.ConfigParser(defaults)
if hasattr(cp, 'readfp') and hasattr(fname, 'readline'): if hasattr(fname, 'readline'):
cp.readfp(fname) cp.readfp(fname)
else: else:
cp.read(fname) cp.read(fname)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment