jenkins-bot has submitted this change and it was merged.
Change subject: Fix Python 3 KeyError ......................................................................
Fix Python 3 KeyError
pywikibot global option 'verbose' causes an exception on Python 3.
Replace algorithm with simpler approach that removes only pywikibot sub-modules like 'wikipedia_family' from the package list.
Change-Id: Ic93b75b7b9e74a66ce3907fa4526e58d694492a5 --- M pywikibot/version.py 1 file changed, 4 insertions(+), 5 deletions(-)
Approvals: XZise: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/version.py b/pywikibot/version.py index 1002ffb..4c02f57 100644 --- a/pywikibot/version.py +++ b/pywikibot/version.py @@ -370,12 +370,11 @@ else: data[name] = info
- # Remove any sub-packages which were loaded with a different name. + # Remove any sub-modules which were loaded with a different name. # e.g. 'wikipedia_family.py' is loaded as 'wikipedia' + _program_dir = _get_program_dir() for path, name in paths.items(): - for other_path in set(paths) - set([path]): - if path.startswith(other_path) and not other_path.startswith(path): - del paths[path] - del data[name] + if _program_dir in path: + del data[name]
return data
pywikibot-commits@lists.wikimedia.org