← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-html5browser-hang into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-html5browser-hang into launchpad:master.

Commit message:
Fix hang in lp.testing.html5browser on Python 3

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/381339

Browser._disconnect didn't take a copy of self.listeners.keys().  On Python 3, this resulted in "RuntimeError: dictionary changed size during iteration", followed by a hang.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-html5browser-hang into launchpad:master.
diff --git a/lib/lp/testing/html5browser.py b/lib/lp/testing/html5browser.py
index e6099e1..b314667 100644
--- a/lib/lp/testing/html5browser.py
+++ b/lib/lp/testing/html5browser.py
@@ -197,7 +197,7 @@ class Browser(WebKit.WebView):
 
     def _disconnect(self, signal=None):
         if signal is None:
-            signals = self.listeners.keys()
+            signals = list(self.listeners.keys())
         elif isinstance(signal, str):
             signals = [signal]
         for key in signals: