[Python-checkins] r78034 - in python/branches/py3k/Lib/logging: __init__.py config.py

georg.brandl python-checkins at python.org
Sat Feb 6 23:27:52 CET 2010


Author: georg.brandl
Date: Sat Feb  6 23:27:51 2010
New Revision: 78034

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

Modified:
   python/branches/py3k/Lib/logging/__init__.py
   python/branches/py3k/Lib/logging/config.py

Modified: python/branches/py3k/Lib/logging/__init__.py
==============================================================================
--- python/branches/py3k/Lib/logging/__init__.py	(original)
+++ python/branches/py3k/Lib/logging/__init__.py	Sat Feb  6 23:27:51 2010
@@ -1559,17 +1559,8 @@
             #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
 

Modified: python/branches/py3k/Lib/logging/config.py
==============================================================================
--- python/branches/py3k/Lib/logging/config.py	(original)
+++ python/branches/py3k/Lib/logging/config.py	Sat Feb  6 23:27:51 2010
@@ -65,7 +65,7 @@
     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)


More information about the Python-checkins mailing list