Skip to content

Commit

Permalink
Use an assertion instead
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jan 31, 2024
1 parent 89ede50 commit dee371f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions datasette/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"datasette.default_magic_parameters",
"datasette.blob_renderer",
"datasette.default_menu_links",
"datasette.default_include_blocks",
"datasette.handle_exception",
"datasette.forbidden",
)
Expand Down
3 changes: 1 addition & 2 deletions datasette/views/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ async def get(self, request):

def include_block_function(name, datasette, request, **kwargs):
method = getattr(pm.hook, name, None)
if method is None:
raise Exception("No hook found for {}".format(name))
assert method is not None, "No hook found for {}".format(name)

async def inner():
html_bits = []
Expand Down

0 comments on commit dee371f

Please sign in to comment.