prettify: fix logger/exception-handling issues

This commit is contained in:
Tiziano Müller 2020-02-13 13:58:51 +01:00 committed by Tiziano Müller
parent ae3c58dc44
commit fbd5a8579c
2 changed files with 5 additions and 5 deletions

View file

@ -449,9 +449,9 @@ def main(argv):
shandler.setLevel(level)
shandler.setFormatter(logging.Formatter("%(levelname)s %(ffilename)s: %(message)s"))
prettify_logger = logging.getLogger("prettify-logger")
prettify_logger.setLevel(level)
prettify_logger.addHandler(shandler)
logger = logging.getLogger("prettify-logger")
logger.setLevel(level)
logger.addHandler(shandler)
failure = 0
total_prettified = 0

View file

@ -1295,9 +1295,9 @@ def rewriteFortranFile(
else:
implicitUses = None
if modulesDict["commonUses"]:
inc_fn = COMMON_USES_RE.match(modulesDict["commonUses"]).group(1)
inc_absfn = os.path.join(os.path.dirname(orig_filename), inc_fn)
try:
inc_fn = COMMON_USES_RE.match(modulesDict["commonUses"]).group(1)
inc_absfn = os.path.join(os.path.dirname(orig_filename), inc_fn)
with open(inc_absfn, "r") as fhandle:
implicitUsesRaw = parseUse(fhandle)
implicitUses = prepareImplicitUses(implicitUsesRaw["modules"])