jenkins-bot has submitted this change and it was merged.
Change subject: (bug 55127) Allow user to abort during http request
......................................................................
(bug 55127) Allow user to abort during http request
KeyboardInterrupts are only processed during Python code, and
thus not during lock acquisition.
Change-Id: Ieea4a9d35ae7b26921584f4b52e4c2f7cf2e63d0
---
M pywikibot/comms/http.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 5e7407b..2aafc7d 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -140,7 +140,8 @@
kwargs["headers"].setdefault("user-agent", useragent)
request = threadedhttp.HttpRequest(baseuri, *args, **kwargs)
http_queue.put(request)
- request.lock.acquire()
+ while not request.lock.acquire(False):
+ time.sleep(0.1)
#TODO: do some error correcting stuff
if isinstance(request.data, SSLHandshakeError):
--
To view, visit
https://gerrit.wikimedia.org/r/110867
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieea4a9d35ae7b26921584f4b52e4c2f7cf2e63d0
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>