Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/129937

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/37/129937/1

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: newchange
Gerrit-Change-Id: I7b4f957b3aa344f8836e0a360f32b6af3a7dd589
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>

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

Reply via email to