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