diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2012-01-22 00:07:27 +0100 |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2012-01-22 00:07:27 +0100 |
commit | b6beb68a34ce18f337527277cdba53b031e004ce (patch) | |
tree | f81e05dc664b2ad487d3cc564a78fe2c763e9ed6 /lib-python/2.7/logging | |
parent | A branch to merge CPython 2.7.2 (diff) | |
download | pypy-b6beb68a34ce18f337527277cdba53b031e004ce.tar.gz pypy-b6beb68a34ce18f337527277cdba53b031e004ce.tar.bz2 pypy-b6beb68a34ce18f337527277cdba53b031e004ce.zip |
Install CPython 2.7.2 version of the std library
Diffstat (limited to 'lib-python/2.7/logging')
-rw-r--r-- | lib-python/2.7/logging/__init__.py | 3 | ||||
-rw-r--r-- | lib-python/2.7/logging/config.py | 10 | ||||
-rw-r--r-- | lib-python/2.7/logging/handlers.py | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/lib-python/2.7/logging/__init__.py b/lib-python/2.7/logging/__init__.py index 2f081a0a85..aaad89884f 100644 --- a/lib-python/2.7/logging/__init__.py +++ b/lib-python/2.7/logging/__init__.py @@ -1627,6 +1627,7 @@ def shutdown(handlerList=_handlerList): h = wr() if h: try: + h.acquire() h.flush() h.close() except (IOError, ValueError): @@ -1635,6 +1636,8 @@ def shutdown(handlerList=_handlerList): # references to them are still around at # application exit. pass + finally: + h.release() except: if raiseExceptions: raise diff --git a/lib-python/2.7/logging/config.py b/lib-python/2.7/logging/config.py index 8e4fa80c6c..5af91d44c8 100644 --- a/lib-python/2.7/logging/config.py +++ b/lib-python/2.7/logging/config.py @@ -226,14 +226,14 @@ def _install_loggers(cp, handlers, disable_existing_loggers): propagate = 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 opts: level = cp.get(sectname, "level") diff --git a/lib-python/2.7/logging/handlers.py b/lib-python/2.7/logging/handlers.py index 472eee5f6c..f8c7164bc1 100644 --- a/lib-python/2.7/logging/handlers.py +++ b/lib-python/2.7/logging/handlers.py @@ -125,6 +125,7 @@ class RotatingFileHandler(BaseRotatingHandler): """ if self.stream: self.stream.close() + self.stream = None if self.backupCount > 0: for i in range(self.backupCount - 1, 0, -1): sfn = "%s.%d" % (self.baseFilename, i) @@ -324,6 +325,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler): """ if self.stream: self.stream.close() + self.stream = None # get the time that this sequence started at and make it a TimeTuple t = self.rolloverAt - self.interval if self.utc: |