log: Fix RAMHandler so the data can change while iterating.
This commit is contained in:
parent
4e200653a0
commit
1dd56e512a
@ -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>')
|
||||
|
Loading…
Reference in New Issue
Block a user