John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/278300

Change subject: tests.utils.execute: accept locale 'C' or missing
......................................................................

tests.utils.execute: accept locale 'C' or missing

As per f7ecddb, for the test suite

Bug: T129406
Change-Id: If097b88c44a9726958511ec77ce57b90db37d00d
---
M tests/utils.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/00/278300/1

diff --git a/tests/utils.py b/tests/utils.py
index bc5cfa2..9c09991 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -806,7 +806,11 @@
     # A complete locale string needs to be created, so the country code
     # is guessed, however it is discarded when loading config.
     if config.userinterface_lang:
-        current_locale = locale.getdefaultlocale()[0].split('.')[0]
+        current_locale = locale.getdefaultlocale()[0]
+        if current_locale in [None, 'C']:
+            current_locale = 'en'
+        else:
+            current_locale = current_locale.split('.')[0]
         locale_prefix = str(config.userinterface_lang + '_')
 
         if not current_locale.startswith(locale_prefix):

-- 
To view, visit https://gerrit.wikimedia.org/r/278300
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If097b88c44a9726958511ec77ce57b90db37d00d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to