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

Change subject: [FIX] Use appropriate error `InvalidTitleError`
......................................................................

[FIX] Use appropriate error `InvalidTitleError`

... and fix some minor typos in the CONTENT.rst file.

Bug: T223895
Change-Id: Ia61b755630db081a481d57c53ba39fc751174e2f
---
M CONTENT.rst
M pywikibot/page/__init__.py
M tests/page_tests.py
3 files changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/CONTENT.rst b/CONTENT.rst
index e43f649..7f66c32 100644
--- a/CONTENT.rst
+++ b/CONTENT.rst
@@ -14,7 +14,7 @@
     
+---------------------------+-----------------------------------------------------------+
     | Dockerfile                | Assemble a Docker image, install all 
dependencies via pip |
     
+---------------------------+-----------------------------------------------------------+
-    | Dockerfile-dev            | Docker image including developement 
dependencies          |
+    | Dockerfile-dev            | Docker image including development 
dependencies           |
     
+---------------------------+-----------------------------------------------------------+
     | HISTORY.rst               | PyPI version history file                    
             |
     
+---------------------------+-----------------------------------------------------------+
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index be3da73..c389ff4 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -5149,8 +5149,8 @@
             if specified, present title using onsite local namespace,
             otherwise use self canonical namespace.

-        :raise pywikibot.exceptions.Error: no corresponding namespace is found
-            in onsite
+        :raise pywikibot.exceptions.InvalidTitleError: no corresponding
+            namespace is found in onsite
         """
         if onsite is None:
             name = self.namespace.canonical_name
@@ -5162,8 +5162,8 @@
                     name = namespace.custom_name
                     break
             else:
-                raise Error(
-                    'No corresponding namespace found for namespace {} on {}.'
+                raise InvalidTitleError(
+                    'No corresponding title found for namespace {} on {}.'
                     .format(self.namespace, onsite))

         if self.namespace != Namespace.MAIN:
diff --git a/tests/page_tests.py b/tests/page_tests.py
index 92e6b98..330b211 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -166,8 +166,8 @@
                                  source=self.enws)
         self.assertEqual(l3.ns_title(), 'Translation:Albert Einstein')
         with self.assertRaisesRegex(
-                Error,
-                'No corresponding namespace found for '
+                InvalidTitleError,
+                'No corresponding title found for '
                 'namespace Translation: on wikisource:it.'):
             l3.ns_title(onsite=self.itws)


--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/757884
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: Ia61b755630db081a481d57c53ba39fc751174e2f
Gerrit-Change-Number: 757884
Gerrit-PatchSet: 5
Gerrit-Owner: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to