Skip to content

Commit

Permalink
prettify: fix logger/exception-handling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-zero committed Feb 24, 2020
1 parent ae3c58d commit fbd5a85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tools/prettify/prettify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tools/prettify/prettify_cp2k/normalizeFortranFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down

0 comments on commit fbd5a85

Please sign in to comment.