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()
--
To view, visit https://gerrit.wikimedia.org/r/551798
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2781e3dab1d261364db149473b321b637054f64d
Gerrit-Change-Number: 551798
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Dalba <[email protected]>
Gerrit-Reviewer: Dvorapa <[email protected]>
Gerrit-Reviewer: Framawiki <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits