From 0c8927627822cabbbae4e14241592171a6973d85 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 24 Dec 2008 01:31:54 -0500 Subject: [PATCH] Fix warning capture crash when running on multiple nodes. --- src/log.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/log.py b/src/log.py index c456487..59440e8 100644 --- a/src/log.py +++ b/src/log.py @@ -273,6 +273,8 @@ class LogManager(object): self.capture_warnings(True) def capture_warnings(self, enable=True): + # FIXME warning capture on multiple processors + import warnings if enable: if self.old_showwarning is None: @@ -291,9 +293,9 @@ class LogManager(object): def _showwarning(self, message, category, filename, lineno): self.old_showwarning(message, category, filename, lineno) - if (self.schema_version >= 1 - and self.mode == "w" - and self.db_conn is not None): + if (self.db_conn is not None + and self.schema_version >= 1 + and self.mode == "w"): self.db_conn.execute("insert into warnings values (?,?,?,?,?)", (self.tick_count, message.message, str(category), filename, lineno)) -- GitLab