jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/696935 )
Change subject: [bugfix] Enable replacements with bool(replacements) is False to be imported ......................................................................
[bugfix] Enable replacements with bool(replacements) is False to be imported
If a replacement is given with _add_deprecated_attr method and its boolean result is false it cannot be imported and an ImportError occurs: ImportError: cannot import name '<replacement>' from '<module>'. Therefore check whether a replacement was given explicitly.
Change-Id: I1158e83c8a40857766d43158e636412701ae6b74 --- M pywikibot/tools/__init__.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py index cfa3859..877d447 100644 --- a/pywikibot/tools/__init__.py +++ b/pywikibot/tools/__init__.py @@ -1886,7 +1886,7 @@ warn(warning_message.format(self._module.__name__, attr, name), FutureWarning if future else DeprecationWarning, 2)
- if repl: + if repl is not None: return repl
if '.' in name:
pywikibot-commits@lists.wikimedia.org