diff options
-rw-r--r-- | Lib/logging/__init__.py | 13 | ||||
-rw-r--r-- | Lib/logging/config.py | 2 |
2 files changed, 3 insertions, 12 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 38b6c7e..7becfda 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -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 diff --git a/Lib/logging/config.py b/Lib/logging/config.py index d5b82b7..16316a9 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -65,7 +65,7 @@ def fileConfig(fname, defaults=None, disable_existing_loggers=True): import configparser cp = configparser.ConfigParser(defaults) - if hasattr(cp, 'readfp') and hasattr(fname, 'readline'): + if hasattr(fname, 'readline'): cp.readfp(fname) else: cp.read(fname) |