jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/663792 )
Change subject: [cleanup] Remove _ResponseDeprecationWrapper
......................................................................
[cleanup] Remove _ResponseDeprecationWrapper
_ResponseDeprecationWrapper was introduced to wrap old data attribute
from http.fetch result; the Response object should always be used
Change-Id: I164bf599e0ba2e93327952a5d51ca882d8821fb4
---
M pywikibot/comms/http.py
1 file changed, 1 insertion(+), 31 deletions(-)
Approvals:
Matěj Suchánek: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 8e3a0be..a0f25fa 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -419,37 +419,7 @@
for callback in callbacks:
callback(response)
- return _ResponseDeprecationWrapper(response)
-
-
-class _ResponseDeprecationWrapper(requests.Response):
-
- """Helper class for the deprecation of HttpRequests.
-
- This class will be removed ASAP. Its only purpose is to allow
- a graceful deprecation of HttpRequests.
- DO NOT USE!
-
- """
-
- def __init__(self, response):
- self.__response = response
-
- def __getattr__(self, attr):
- return getattr(self.__response, attr)
-
- def __setattr__(self, attr, val):
- if attr == '_ResponseDeprecationWrapper__response':
- object.__setattr__(self, attr, val)
-
- return setattr(self.__response, attr, val)
-
- @property
- @deprecated('attribute/methods of Response(), '
- 'which is now returned from http.fetch()',
- since='20210110', future_warning=True)
- def data(self):
- return self
+ return response
def _get_encoding_from_response_headers(response):
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/663792
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: I164bf599e0ba2e93327952a5d51ca882d8821fb4
Gerrit-Change-Number: 663792
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: Mpaa <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits