log: Fix RAMHandler so the data can change while iterating.

This commit is contained in:
Florian Bruhin 2014-08-05 23:07:25 +02:00
parent 4e200653a0
commit 1dd56e512a

View File

@ -338,7 +338,12 @@ class RAMHandler(logging.Handler):
else:
fmt = self.format
lines = []
for record in self.data:
self.acquire()
try:
records = list(self.data)
finally:
self.release()
for record in records:
lines.append(fmt(record))
if html:
lines.append('</table>')