]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove Python 1.x or 2.x compatibility code.
authorGeorg Brandl <georg@python.org>
Sat, 6 Feb 2010 22:27:51 +0000 (22:27 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 6 Feb 2010 22:27:51 +0000 (22:27 +0000)
Lib/logging/__init__.py
Lib/logging/config.py

index 38b6c7eeaab08f30be4159033360a25252b7f17e..7becfdab15566dfd2dffd081fab1240722331cb7 100644 (file)
@@ -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
 
index d5b82b7e61a68895ce303c467129ded0319a6591..16316a956bcc9962d806f7c18d2fd4d7ae75b437 100644 (file)
@@ -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)