jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1101208?usp=email )
Change subject: Fix use of importlib.metadata.entry_points in python 3.9 ......................................................................
Fix use of importlib.metadata.entry_points in python 3.9
entry_points() did not take arguments until python 3.10
Bug: T381734 Change-Id: Ib01641ffa83be1e243615903eca95d872633ff2b --- M pywikibot/scripts/wrapper.py 1 file changed, 12 insertions(+), 1 deletion(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/scripts/wrapper.py b/pywikibot/scripts/wrapper.py index a9bfc8f..1096e09 100755 --- a/pywikibot/scripts/wrapper.py +++ b/pywikibot/scripts/wrapper.py @@ -421,7 +421,18 @@
from pywikibot.i18n import set_messages_package
- for ep in entry_points(name='scriptspath', group='pywikibot'): + if sys.version_info < (3, 10): + entry_points_items = [ + ep for ep in entry_points().get('pywikibot', []) + if ep.name == 'scriptspath' + ] + else: + entry_points_items = entry_points( + name='scriptspath', + group='pywikibot', + ) + + for ep in entry_points_items: path = ep.load() found = test_paths([''], path) if found:
pywikibot-commits@lists.wikimedia.org