summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2010-10-19 21:13:49 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2010-10-19 21:13:49 (GMT)
commitfc082cafa6076ab3ef06638643d93a6313f36e72 (patch)
treeffb2ab4f6a6c02346331589d0098bfd983930cd9 /Lib/logging
parent435d306aa99bb77be7098ce8ecbf2ba048afe115 (diff)
downloadcpython-fc082cafa6076ab3ef06638643d93a6313f36e72.zip
cpython-fc082cafa6076ab3ef06638643d93a6313f36e72.tar.gz
cpython-fc082cafa6076ab3ef06638643d93a6313f36e72.tar.bz2
logging: Documented usage of callables as filters.
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/__init__.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 551d85e..03ceb9c 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -613,13 +613,8 @@ class Filterer(object):
for f in self.filters:
if hasattr(f, 'filter'):
result = f.filter(record)
- elif hasattr(f, '__call__'):
- try:
- result = f(record)
- except Exception:
- result = True # filter failed, assume a pass
else:
- result = False # we don't know what f is
+ result = f(record) # assume callable - will raise if not
if not result:
rv = 0
break