jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/610803 )

Change subject: [4.0] Remove Python 2 related code from threadedhttp.py
......................................................................

[4.0] Remove Python 2 related code from threadedhttp.py

- reorder imports
- remove UnicodeMixin

Change-Id: I744d4a112c2411309be224d2c723c09ab9a69979
---
M pywikibot/comms/threadedhttp.py
1 file changed, 7 insertions(+), 13 deletions(-)

Approvals:
  Zhuyifei1999: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/comms/threadedhttp.py b/pywikibot/comms/threadedhttp.py
index b902f67..1f24e6b 100644
--- a/pywikibot/comms/threadedhttp.py
+++ b/pywikibot/comms/threadedhttp.py
@@ -1,37 +1,31 @@
 # -*- coding: utf-8 -*-
 """Http backend layer, formerly providing a httplib2 wrapper."""
 #
-# (C) Pywikibot team, 2007-2019
+# (C) Pywikibot team, 2007-2020
 #
 # Distributed under the terms of the MIT license.
 #
-from __future__ import absolute_import, division, unicode_literals
-
-
 __docformat__ = 'epytext'

 # standard python libraries
 import codecs
 import re

-import pywikibot
-from pywikibot.tools import deprecated, PY2, UnicodeMixin
+from urllib.parse import urlparse

-if not PY2:
-    from urllib.parse import urlparse
-else:
-    from urlparse import urlparse
+import pywikibot
+from pywikibot.tools import deprecated


 _logger = 'comm.threadedhttp'


-class HttpRequest(UnicodeMixin):
+class HttpRequest:

     """Object wrapper for HTTP requests that need to block origin thread.

     self.data will be either:
-    * a tuple of (dict, unicode) if the request was successful
+    * a tuple of (dict, str) if the request was successful
     * an exception
     """

@@ -200,7 +194,7 @@
         """Return the response decoded by the detected encoding."""
         return self.decode(self.encoding)

-    def __unicode__(self):
+    def __str__(self):
         """Return the response decoded by the detected encoding."""
         return self.text
 

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/610803
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I744d4a112c2411309be224d2c723c09ab9a69979
Gerrit-Change-Number: 610803
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Zhuyifei1999 <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to