jenkins-bot has submitted this change and it was merged.

Change subject: [FIX] threadedhttp: Don't unpack exceptions
......................................................................


[FIX] threadedhttp: Don't unpack exceptions

If the redirect issued an exception, it shouldn't be unpacked but
instead directly returned like a normal exception.

Change-Id: Iaf548e569e774c6ee4682edf5f571b12321588d7
---
M pywikibot/comms/threadedhttp.py
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  XZise: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/pywikibot/comms/threadedhttp.py b/pywikibot/comms/threadedhttp.py
index 43358ef..e3c0e64 100644
--- a/pywikibot/comms/threadedhttp.py
+++ b/pywikibot/comms/threadedhttp.py
@@ -254,10 +254,12 @@
                                   method in ["GET", "HEAD"]))
         if (self.follow_redirects and (max_redirects > 0) and
                 redirectable_response):
-            (response, content) = self._follow_redirect(
+            # Return directly and not unpack the values in case the result was
+            # an exception, which can't be unpacked
+            return self._follow_redirect(
                 uri, method, body, headers, response, content, max_redirects)
-
-        return response, content
+        else:
+            return response, content
 
     def _follow_redirect(self, uri, method, body, headers, response,
                          content, max_redirects):

-- 
To view, visit https://gerrit.wikimedia.org/r/191042
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaf548e569e774c6ee4682edf5f571b12321588d7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to