jenkins-bot submitted this change.

View Change


Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[doc] Remove outdated basestring type hints

Change-Id: I7f8b92b28a04fd9b56d8d25ca00d28eabd9f1c85
---
M pywikibot/textlib.py
1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 7439253..ce63410 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -1,8 +1,4 @@
-"""Functions for manipulating wiki-text.
-
-Unless otherwise noted, all functions take a unicode string as the
-argument and return a unicode string.
-"""
+"""Functions for manipulating wiki-text."""
#
# (C) Pywikibot team, 2008-2023
#
@@ -655,8 +651,7 @@

If it's a string and the replacement was a sequence it converts it into a
Page instance. If the replacement is done via a callable it'll use it like
- unlinking and directly replace the link with the text itself. It only
- supports unicode when used by the callable and bytes are not allowed.
+ unlinking and directly replace the link with the text itself.

If either the section or label should be used the replacement can be a
function which returns a Link instance and copies the value which should
@@ -815,8 +810,6 @@
new_link = new_label

if isinstance(new_link, str):
- # Nothing good can come out of the fact that bytes is returned so
- # force unicode
text = text[:start] + new_link + text[end:]
# Make sure that next time around we will not find this same hit.
curpos = start + len(new_link)

To view, visit change 920321. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7f8b92b28a04fd9b56d8d25ca00d28eabd9f1c85
Gerrit-Change-Number: 920321
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged