diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-03-07 18:14:36 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-03-07 18:14:36 (GMT) |
commit | 4bcfb92168aeb358479f9149461ac23983a50232 (patch) | |
tree | bc86c39e48182aef401af186903873fc7784f885 /Lib/logging | |
parent | 52d3e7e6a59954bd375369843dabdea23bb1dfd3 (diff) | |
parent | 9f9991c2f565cc9494a7bac163f1e2c34afffc09 (diff) | |
download | cpython-4bcfb92168aeb358479f9149461ac23983a50232.zip cpython-4bcfb92168aeb358479f9149461ac23983a50232.tar.gz cpython-4bcfb92168aeb358479f9149461ac23983a50232.tar.bz2 |
Issue #11424: Merged fix from 3.2.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/config.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py index 5afdf9f..c7359ca 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -226,14 +226,14 @@ def _install_loggers(cp, handlers, disable_existing): propagate = section.getint("propagate", fallback=1) logger = logging.getLogger(qn) if qn in existing: - i = existing.index(qn) + i = existing.index(qn) + 1 # start with the entry after qn prefixed = qn + "." pflen = len(prefixed) num_existing = len(existing) - i = i + 1 # look at the entry after qn - while (i < num_existing) and (existing[i][:pflen] == prefixed): - child_loggers.append(existing[i]) - i = i + 1 + while i < num_existing: + if existing[i][:pflen] == prefixed: + child_loggers.append(existing[i]) + i += 1 existing.remove(qn) if "level" in section: level = section["level"] @@ -596,15 +596,14 @@ class DictConfigurator(BaseConfigurator): loggers = config.get('loggers', EMPTY_DICT) for name in loggers: if name in existing: - i = existing.index(name) + i = existing.index(name) + 1 # look after name prefixed = name + "." pflen = len(prefixed) num_existing = len(existing) - i = i + 1 # look at the entry after name - while (i < num_existing) and\ - (existing[i][:pflen] == prefixed): - child_loggers.append(existing[i]) - i = i + 1 + while i < num_existing: + if existing[i][:pflen] == prefixed: + child_loggers.append(existing[i]) + i += 1 existing.remove(name) try: self.configure_logger(name, loggers[name]) |