Skip to content

Commit

Permalink
Merge "[bugfix] Raise ImportError if no editor is available"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Apr 27, 2017
2 parents ba2e4ce + ac1d5ed commit db2e841
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pywikibot/editor.py
Expand Up @@ -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.
#
Expand Down Expand Up @@ -118,7 +118,7 @@ def edit(self, text, jumpIndex=None, highlight=None):
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 '
Expand Down
2 changes: 2 additions & 0 deletions pywikibot/specialbots.py
Expand Up @@ -354,6 +354,8 @@ def process_filename(self, file_url=None):
editor = editarticle.TextEditor()
try:
newDescription = editor.edit(self.description)
except ImportError:
raise
except Exception as e:
pywikibot.error(e)
continue
Expand Down

0 comments on commit db2e841

Please sign in to comment.