jenkins-bot submitted this change.
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(-)
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:
To view, visit change 1101208. To unsubscribe, or for help writing mail filters, visit settings.