jenkins-bot has submitted this change and it was merged.

Change subject: [bugfix] QueryGenerator may have action="query" parameter
......................................................................


[bugfix] QueryGenerator may have action="query" parameter

The constructor of QueryGenerator may have action="query" as
arcument.

The current release always raise the Error message when an action
parameter is given, even the parameter's value is "query" because
"action" != "query" is always true.

This patch fixes the constructor in the right way.

Change-Id: I7b4f957b3aa344f8836e0a360f32b6af3a7dd589
---
M pywikibot/data/api.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index f129665..72ebb3b 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -499,9 +499,9 @@
         assumed.
 
         """
-        if "action" in kwargs and "action" != "query":
+        if "action" in kwargs and kwargs["action"] != "query":
             raise Error("%s: 'action' must be 'query', not %s"
-                        % (self.__class__.__name__, kwargs["query"]))
+                        % (self.__class__.__name__, kwargs["action"]))
         else:
             kwargs["action"] = "query"
         try:

-- 
To view, visit https://gerrit.wikimedia.org/r/129937
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7b4f957b3aa344f8836e0a360f32b6af3a7dd589
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Russell Blau <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to