mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix for plugins in Python 3.5 (#222)
ModuleNotFoundError is not a thing in Python 3.5, so catch KeyError/ImportError instead.
This commit is contained in:
parent
1c36d07dd4
commit
4be6deb947
1 changed files with 2 additions and 2 deletions
|
|
@ -1308,8 +1308,8 @@ class Datasette:
|
|||
modpath = '/-/static-plugins/{}/'.format(plugin_module.__name__)
|
||||
dirpath = pkg_resources.resource_filename(plugin_module.__name__, 'static')
|
||||
app.static(modpath, dirpath)
|
||||
except ModuleNotFoundError:
|
||||
# Caused by --plugins_dir= plugins
|
||||
except (KeyError, ImportError):
|
||||
# Caused by --plugins_dir= plugins - KeyError/ImportError thrown in Py3.5
|
||||
pass
|
||||
app.add_route(
|
||||
DatabaseView.as_view(self),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue