Skip to content

Instantly share code, notes, and snippets.

@shomah4a
Created May 18, 2012 00:05
Show Gist options
  • Save shomah4a/2722362 to your computer and use it in GitHub Desktop.
Save shomah4a/2722362 to your computer and use it in GitHub Desktop.
themecore で読めないテーマがあったときに死んじゃう
diff -r 040c63f8dec8 src/sphinxjp/themecore/__init__.py
--- a/src/sphinxjp/themecore/__init__.py Sat Jul 09 23:25:39 2011 +0900
+++ b/src/sphinxjp/themecore/__init__.py Fri May 18 09:05:10 2012 +0900
@@ -24,7 +24,12 @@
theme_paths = []
for plugin in pkg_resources.iter_entry_points('sphinx_themes'):
- m = plugin.load()
+ try:
+ m = plugin.load()
+ except ImportError:
+ sys.stdout.write("warn: Can't import '{0}'".format(plugin.module_name))
+ continue
+
if callable(m):
path = m()
else:
@@ -42,7 +47,12 @@
def setup_directives(app):
for plugin in pkg_resources.iter_entry_points('sphinx_directives'):
- module_setup = plugin.load()
+ try:
+ module_setup = plugin.load()
+ except ImportError:
+ sys.stdout.write("warn: Can't import '{0}'".format(plugin.module_name))
+ continue
+
module_setup(app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment