jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/349789 )

Change subject: [bugfix] Raise ImportError if no editor is available
......................................................................


[bugfix] Raise ImportError if no editor is available

- specialbot may catch ImportError first and stop the script
  whereas other exceptions may continue looping

Bug: T163632
Change-Id: Ic1dde77337ac9fd378e7105fc675c3f8cc52fbd2
---
M pywikibot/editor.py
M pywikibot/specialbots.py
2 files changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/pywikibot/editor.py b/pywikibot/editor.py
index e878a5d..6d61f34 100644
--- a/pywikibot/editor.py
+++ b/pywikibot/editor.py
@@ -5,7 +5,7 @@
 
 #
 # (C) Gerrit Holl, 2004
-# (C) Pywikibot team, 2004-2015
+# (C) Pywikibot team, 2004-2017
 #
 # Distributed under the terms of the MIT license.
 #
@@ -118,7 +118,7 @@
                 os.unlink(tempFilename)
 
         if isinstance(gui, ImportError):
-            raise pywikibot.Error(
+            raise ImportError(
                 'Could not load GUI modules: %s\nNo editor available.\n'
                 'Set your favourite editor in user-config.py "editor", '
                 'or install python packages tkinter and idlelib, which '
diff --git a/pywikibot/specialbots.py b/pywikibot/specialbots.py
index 72e079c..bd6c4d2 100644
--- a/pywikibot/specialbots.py
+++ b/pywikibot/specialbots.py
@@ -354,6 +354,8 @@
                 editor = editarticle.TextEditor()
                 try:
                     newDescription = editor.edit(self.description)
+                except ImportError:
+                    raise
                 except Exception as e:
                     pywikibot.error(e)
                     continue

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic1dde77337ac9fd378e7105fc675c3f8cc52fbd2
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Dalba <[email protected]>
Gerrit-Reviewer: Framawiki <[email protected]>
Gerrit-Reviewer: Magul <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to