diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-10-19 21:13:49 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-10-19 21:13:49 (GMT) |
commit | fc082cafa6076ab3ef06638643d93a6313f36e72 (patch) | |
tree | ffb2ab4f6a6c02346331589d0098bfd983930cd9 /Lib/logging | |
parent | 435d306aa99bb77be7098ce8ecbf2ba048afe115 (diff) | |
download | cpython-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__.py | 7 |
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 |