Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Alsina committed Feb 16, 2018
1 parent aa25ad6 commit 6561058
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions v7/latex/latex/__init__.py
Expand Up @@ -173,7 +173,7 @@ def set_site(self, site):
LOGGER.warn('Found unknown LaTeX page compiler plugin {0}!'.format(plugin.name))
other_plugins[plugin.name] = plugin
plugin.plugin_object.initialize(self, self.__parsing_environment)
except:
except Exception:
LOGGER.error('Found broken LaTeX page compiler plugin {0}!'.format(plugin.name))

# Look for formula renderer
Expand Down Expand Up @@ -340,11 +340,11 @@ def compile(self, source, dest, is_two_file=True, post=None, lang=None):
post.add_dependency_uptodate(nikola.utils.config_changed(uptodate_data['deps'], uptodate_data['name']), add='page', lang=lang)
for plugin in self.__all_plugins:
plugin.write_extra_targets(post, lang, dest, latex_context)
except:
except Exception:
# If an exception was raised, remove output file and re-raise it
try:
os.unlink(dest)
except:
except Exception:
pass
raise

Expand Down
2 changes: 1 addition & 1 deletion v7/latex/latex/parser.py
Expand Up @@ -572,7 +572,7 @@ def __add_language(self, element, language, inline=True):
def __parse_symbol(self, code):
try:
code = int(code)
except:
except Exception:
raise ParseError(self.tokens, "Cannot interpret symbol '{0}'!".format(code), filename=self.filename)
return tree.WordPart(chr(code))

Expand Down
2 changes: 1 addition & 1 deletion v7/latex/latex/plugins/latex_formula_image_renderer.py
Expand Up @@ -199,7 +199,7 @@ def render(self, formula, formula_context, formula_type, latex_context):
"""
try:
lfr = self.site.latex_formula_renderer
except:
except Exception:
LOGGER.error("Cannot find latex formula rendering plugin!")
sys.exit(1)
src, width, height = lfr.compile(formula, formula_context.color, formula_context.scale, formula_type, engine=self.__formula_engine)
Expand Down
4 changes: 2 additions & 2 deletions v7/latex_formula_renderer/latex_formula_renderer.py
Expand Up @@ -965,14 +965,14 @@ def _render_test_formulae(engines):
_LOGGER.warn("WARNING while processing engine {0}, output format {1}, formula #{2} of type {3}: {4}".format(engine, output_format, i, formula_type, e))
try:
os.path.remove(out_file)
except:
except Exception:
pass
except Exception as e:
_LOGGER.error("FAILURE while processing engine {0}, output format {1}, formula #{2} of type {3} with value '{4}'.".format(engine, output_format, i, formula_type, formula))
_LOGGER.error(e)
try:
os.path.remove(out_file)
except:
except Exception:
pass


Expand Down
2 changes: 1 addition & 1 deletion v7/markmin/markmin/markmin2html.py
Expand Up @@ -646,7 +646,7 @@ def u2(match, env=env):
b = match.group('b')
try:
b = safe_eval(make_dict(b), env)
except:
except Exception:
pass
try:
f = f(**b) if isinstance(b, dict) else f(b)
Expand Down
2 changes: 1 addition & 1 deletion v7/mediawiki/mediawiki.py
Expand Up @@ -39,7 +39,7 @@
from lxml import etree
try:
import smc.mw as mw
except:
except ImportError:
mw = None

from nikola.plugin_categories import PageCompiler
Expand Down
2 changes: 1 addition & 1 deletion v7/planetoid/planetoid.py
Expand Up @@ -158,7 +158,7 @@ def update_feed(feed):
modified=modified
)
feed.last_status = str(parsed.status)
except: # Probably a timeout
except Exception: # Probably a timeout
# TODO: log failure
return
if parsed.feed.get('title'):
Expand Down
2 changes: 1 addition & 1 deletion v7/slimish/slimish.py
Expand Up @@ -40,7 +40,7 @@
try:
from slimish_jinja.lexer import Lexer
from slimish_jinja.parse import Parser
except:
except ImportError:
Lexer, Parser = (None, None) # NOQA

try:
Expand Down
2 changes: 1 addition & 1 deletion v7/tags/tags.py
Expand Up @@ -370,7 +370,7 @@ def _execute(self, options, args):

try:
self.site.scan_posts(True, True)
except:
except Exception:
# old nikola
self.site.scan_posts()

Expand Down
2 changes: 1 addition & 1 deletion v7/wordpress_compiler/wordpress/wordpress.py
Expand Up @@ -241,7 +241,7 @@ def _read_similar_file(self, source, suffix):
with open(candidate, "rb") as in_file:
# _LOGGER.info("Found file {0} for {1}.".format(candidate, source))
return in_file.read(), candidate
except:
except Exception:
pass
return None, None

Expand Down
2 changes: 1 addition & 1 deletion v8/markmin/markmin/markmin2html.py
Expand Up @@ -646,7 +646,7 @@ def u2(match, env=env):
b = match.group('b')
try:
b = safe_eval(make_dict(b), env)
except:
except Exception:
pass
try:
f = f(**b) if isinstance(b, dict) else f(b)
Expand Down
2 changes: 1 addition & 1 deletion v8/mediawiki/mediawiki.py
Expand Up @@ -38,7 +38,7 @@
from lxml import etree
try:
import smc.mw as mw
except:
except ImportError:
mw = None

from nikola import shortcodes as sc
Expand Down

0 comments on commit 6561058

Please sign in to comment.