jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/551798 )
Change subject: [IMPR] Use a set for _locked_pages lookup ......................................................................
[IMPR] Use a set for _locked_pages lookup
Change-Id: I2781e3dab1d261364db149473b321b637054f64d --- M pywikibot/site.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: D3r1ck01: Looks good to me, but someone else must approve Framawiki: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index ffa61ff..29493b1 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -789,7 +789,7 @@
# following are for use with lock_page and unlock_page methods self._pagemutex = threading.Lock() - self._locked_pages = [] + self._locked_pages = set()
@deprecated(since='20141225') def has_api(self): @@ -1085,7 +1085,7 @@ time.sleep(.25) self._pagemutex.acquire()
- self._locked_pages.append(title) + self._locked_pages.add(title) finally: # time.sleep may raise an exception from signal handler (eg: # KeyboardInterrupt) while the lock is released, and there is no @@ -1107,7 +1107,7 @@ """ self._pagemutex.acquire() try: - self._locked_pages.remove(page.title(with_section=False)) + self._locked_pages.discard(page.title(with_section=False)) finally: self._pagemutex.release()
pywikibot-commits@lists.wikimedia.org