kopia lustrzana https://github.com/simonw/datasette
Fix for plugins in Python 3.5 (#222)
ModuleNotFoundError is not a thing in Python 3.5, so catch KeyError/ImportError instead.pull/232/head
rodzic
1c36d07dd4
commit
4be6deb947
|
|
@ -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),
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue