jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1338046?usp=email )
Change subject: version: Avoid redundant package name splitting
......................................................................
version: Avoid redundant package name splitting
Extract root package names at the first dot with partition instead of
splitting every component. Reuse those root names directly when selecting
builtin packages, since they no longer contain dots.
Change-Id: I9d8a9a93496896ec04a04d606fc9976f8417f983
---
M pywikibot/version.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/version.py b/pywikibot/version.py
index 8d76fe8..2762366 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -301,9 +301,9 @@
std_lib_dir = pathlib.Path(sysconfig.get_paths()['stdlib'])
- root_packages = {key.split('.')[0] for key in modules}
+ root_packages = {key.partition('.')[0] for key in modules}
- builtin_packages = {name.split('.')[0] for name in root_packages
+ builtin_packages = {name for name in root_packages
if name in sys.builtin_module_names
or '_' + name in sys.builtin_module_names}
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1338046?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: I9d8a9a93496896ec04a04d606fc9976f8417f983
Gerrit-Change-Number: 1338046
Gerrit-PatchSet: 2
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]