Skip to content

Commit

Permalink
Merge pull request #51 from apache/base-exception
Browse files Browse the repository at this point in the history
Don't catch BaseException
  • Loading branch information
clambertus committed Jun 27, 2023
2 parents 2a15030 + 7dbb80b commit 4b6ee66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bin/buildsite.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def start_build(args):
f.write("""
try:
PLUGINS += ['toc']
except:
except Exception: # TODO: narrow further to expected Exceptions
PLUGINS = ['toc', 'gfm']
""")

Expand Down Expand Up @@ -183,7 +183,7 @@ def start_build(args):
print("- Doing fresh checkout of branch %s" % args.outputbranch)
subprocess.run((GIT, 'checkout', args.outputbranch, '-f'), check=True)
subprocess.run((GIT, 'pull'), check=True)
except:
except Exception: # TODO: narrow further to expected Exceptions
print("- Branch %s does not exist (yet), creating it..." % args.outputbranch)
# If .asf.yaml exists, which it should, make a copy of it in memory for later
asfyml = os.path.join(sourcepath, '.asf.yaml')
Expand Down
4 changes: 2 additions & 2 deletions plugins/md_inline_extension/inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def process_settings(pelicanobj):
# Get the user specified settings
try:
settings = pelicanobj.settings['MD_INLINE']
except:
except Exception: # TODO: narrow further to expected Exceptions
settings = None

# If settings have been specified, add them to the config
Expand All @@ -45,7 +45,7 @@ def inline_markdown_extension(pelicanobj, config):
pelicanobj.settings['MD_EXTENSIONS'].append(PelicanInlineMarkdownExtension(config))
else:
pelicanobj.settings['MARKDOWN'].setdefault('extensions', []).append(PelicanInlineMarkdownExtension(config))
except:
except Exception: # TODO: narrow further to expected Exceptions
sys.excepthook(*sys.exc_info())
sys.stderr.write("\nError - the pelican Markdown extension failed to configure. Inline Markdown extension is non-functional.\n")
sys.stderr.flush()
Expand Down

0 comments on commit 4b6ee66

Please sign in to comment.