]> granicus.if.org Git - python/commitdiff
Calling __import__ as a method technically works, but really should be wrapped
authorBrett Cannon <bcannon@gmail.com>
Sat, 12 Jun 2010 00:39:28 +0000 (00:39 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 12 Jun 2010 00:39:28 +0000 (00:39 +0000)
in a staticmethod. This is important for when __import__ is set to a function
defined in Python instead of C.

Lib/logging/config.py

index f5971c2bcfbc6da4f99a7b30fa33f8abdcc6f5f0..1e5ff6875ebd29dbc8e998091a83e6cfd3c504e9 100644 (file)
@@ -373,7 +373,7 @@ class BaseConfigurator(object):
     }
 
     # We might want to use a different one, e.g. importlib
-    importer = __import__
+    importer = staticmethod(__import__)
 
     def __init__(self, config):
         self.config = ConvertingDict(config)