summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2011-10-28 12:45:05 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2011-10-28 12:45:05 (GMT)
commit5d1155c08edf7f53eca804b2b6538636c2dfe711 (patch)
treedcb2cf857c20dce837c82de7aea432ccf9a41355 /Lib/logging
parentf99e4b5dbef57e13dd603dcc0edd9b7318f08c28 (diff)
downloadcpython-5d1155c08edf7f53eca804b2b6538636c2dfe711.zip
cpython-5d1155c08edf7f53eca804b2b6538636c2dfe711.tar.gz
cpython-5d1155c08edf7f53eca804b2b6538636c2dfe711.tar.bz2
Closes #13258: Use callable() built-in in the standard library.
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/config.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index c7359ca..373da2b 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -471,7 +471,7 @@ class BaseConfigurator(object):
def configure_custom(self, config):
"""Configure an object with a user-supplied factory."""
c = config.pop('()')
- if not hasattr(c, '__call__'):
+ if not callable(c):
c = self.resolve(c)
props = config.pop('.', None)
# Check for valid identifiers
@@ -690,7 +690,7 @@ class DictConfigurator(BaseConfigurator):
filters = config.pop('filters', None)
if '()' in config:
c = config.pop('()')
- if not hasattr(c, '__call__') and hasattr(types, 'ClassType') and type(c) != types.ClassType:
+ if not callable(c):
c = self.resolve(c)
factory = c
else: