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__) |                     modpath = '/-/static-plugins/{}/'.format(plugin_module.__name__) | ||||||
|                     dirpath = pkg_resources.resource_filename(plugin_module.__name__, 'static') |                     dirpath = pkg_resources.resource_filename(plugin_module.__name__, 'static') | ||||||
|                     app.static(modpath, dirpath) |                     app.static(modpath, dirpath) | ||||||
|             except ModuleNotFoundError: |             except (KeyError, ImportError): | ||||||
|                 # Caused by --plugins_dir= plugins |                 # Caused by --plugins_dir= plugins - KeyError/ImportError thrown in Py3.5 | ||||||
|                 pass |                 pass | ||||||
|         app.add_route( |         app.add_route( | ||||||
|             DatabaseView.as_view(self), |             DatabaseView.as_view(self), | ||||||
|  |  | ||||||
		Ładowanie…
	
		Reference in New Issue
	
	 Simon Willison
						Simon Willison