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

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 4fe6caa8d05d0b2e4ca2122fd0cdb1b953bfdff2
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-html5browser-hang
Merge into: launchpad:master
Diff against target: 13 lines (+1/-1)
1 file modified
lib/lp/testing/html5browser.py (+1/-1)
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Review via email: mp+381339@code.launchpad.net

Commit message

Fix hang in lp.testing.html5browser on Python 3

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/testing/html5browser.py b/lib/lp/testing/html5browser.py
2index e6099e1..b314667 100644
3--- a/lib/lp/testing/html5browser.py
4+++ b/lib/lp/testing/html5browser.py
5@@ -197,7 +197,7 @@ class Browser(WebKit.WebView):
6
7 def _disconnect(self, signal=None):
8 if signal is None:
9- signals = self.listeners.keys()
10+ signals = list(self.listeners.keys())
11 elif isinstance(signal, str):
12 signals = [signal]
13 for key in signals:

Subscribers

People subscribed via source and target branches

to status/vote changes: