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

Change subject: [IMPR] fix typos and deprecate function in PageRelatedError
......................................................................

[IMPR] fix typos and deprecate function in PageRelatedError

Fix IDE warnings:
- deprecate getPage()
- fix param names in docstring

Change-Id: I9ceeea98e0903021be38499d98dea6d0844e58d8
---
M pywikibot/exceptions.py
1 file changed, 6 insertions(+), 4 deletions(-)

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



diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index 69326cc..9a9dd28 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -89,7 +89,7 @@
 #
 from typing import Optional

-from pywikibot.tools import _NotImplementedWarning
+from pywikibot.tools import deprecated, _NotImplementedWarning


 class NotImplementedWarning(_NotImplementedWarning):
@@ -161,8 +161,10 @@
         else:
             super().__init__(self.message % page)

+    @deprecated('PageRelatedError.page attribute', since='20201016',
+                future_warning=True)
     def getPage(self):
-        """Return the page related to the exception."""
+        """DEPRECATED. Return the page related to the exception."""
         return self.page


@@ -251,7 +253,7 @@
         @param page: Page that caused the exception
         @type page: Page object
         @param actual: title obtained by query
-        @type reason: basestring
+        @type actual: basestring

         """
         self.message = "Query on %s returned data on '{0}'".format(actual)
@@ -336,7 +338,7 @@
         """Initializer.

         @param target_page: Target page of the redirect.
-        @type reason: Page
+        @type target_page: Page
         """
         self.target_page = target_page
         self.target_site = target_page.site

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/634482
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: I9ceeea98e0903021be38499d98dea6d0844e58d8
Gerrit-Change-Number: 634482
Gerrit-PatchSet: 6
Gerrit-Owner: 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

Reply via email to