jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1345286?usp=email )

Change subject: Skip ASCII digit conversion for default languages
......................................................................

Skip ASCII digit conversion for default languages

Return ASCII strings immediately when no language selection is supplied.
Their characters cannot match the non-ASCII digit mapping, so avoid
building the translation table and running str.translate().

Keep the existing path for explicit language selections and non-ASCII
text. TimeStripper uses the default selection for each discussion line.

Change-Id: Id8c7c6600f8a46af6fb801f61b8d532688d22081
---
M pywikibot/textlib.py
1 file changed, 3 insertions(+), 0 deletions(-)

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




diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 0c0cfe6..3a07c66 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -149,6 +149,9 @@
         known languages to convert.
     :return: The string with ascii digits
     """
+    if langs is None and phrase.isascii():
+        return phrase
+
     if langs is None:
         langs = NON_ASCII_DIGITS.keys()
     elif isinstance(langs, str):

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

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Id8c7c6600f8a46af6fb801f61b8d532688d22081
Gerrit-Change-Number: 1345286
Gerrit-PatchSet: 1
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to