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

Change subject: (bugfix) continue handleargs with localargs
......................................................................


(bugfix) continue handleargs with localargs

pywikibot.handleArgs is guaranteed to return a list (as opposed
to a generator) after parsing all global arguments (such as
-lang and -family). generatorFactory must be instanced after that because it 
needs the site object.

Change-Id: I365dd03abdd288e5f0e55694f5299b6a7e6511a2
---
M scripts/protect.py
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/protect.py b/scripts/protect.py
index 70035c0..5b26df1 100644
--- a/scripts/protect.py
+++ b/scripts/protect.py
@@ -114,7 +114,6 @@
     # This factory is responsible for processing command line arguments
     # that are also used by other scripts and that determine on which pages
     # to work on.
-    genFactory = pagegenerators.GeneratorFactory()
     pageName = ''
     summary = None
     always = False
@@ -124,10 +123,11 @@
     defaultProtection = 'sysop'
 
     # read command line parameters
-    localargs = pywikibot.handleArgs()
+    localargs = pywikibot.handleArgs(*args)
+    genFactory = pagegenerators.GeneratorFactory()
     mysite = pywikibot.Site()
 
-    for arg in pywikibot.handleArgs(*args):
+    for arg in localargs:
         if arg == '-always':
             always = True
         elif arg.startswith('-summary'):

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

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

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

Reply via email to