Created
May 18, 2012 00:05
-
-
Save shomah4a/2722362 to your computer and use it in GitHub Desktop.
themecore で読めないテーマがあったときに死んじゃう
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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