Skip to content
Permalink
Browse files
lint
  • Loading branch information
ralsina committed Feb 16, 2018
1 parent aa25ad6 commit 65610588f5a17118567aa96d3f44597f52af943d
@@ -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
@@ -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

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

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


@@ -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)
@@ -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
@@ -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'):
@@ -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:
@@ -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()

@@ -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

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

0 comments on commit 6561058

Please sign in to comment.