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:

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/696935
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I1158e83c8a40857766d43158e636412701ae6b74
Gerrit-Change-Number: 696935
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to