diff options
author | Georg Brandl <georg@python.org> | 2017-01-25 07:58:50 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2017-01-25 07:58:50 +0100 |
commit | 5b8414636e8654c447b4e0204e204e86afd76faa (patch) | |
tree | c560046730e5f4e8f1e4f70357955f27113f6c61 | |
parent | 7f1e0a5c97eb1ce6d9108d1d03fb648565830c14 (diff) | |
download | pygments-git-5b8414636e8654c447b4e0204e204e86afd76faa.tar.gz |
PR#662: catch IOError from pkg_resources import
-rw-r--r-- | pygments/plugin.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pygments/plugin.py b/pygments/plugin.py index 7987d646..08d9b5b4 100644 --- a/pygments/plugin.py +++ b/pygments/plugin.py @@ -40,14 +40,16 @@ FORMATTER_ENTRY_POINT = 'pygments.formatters' STYLE_ENTRY_POINT = 'pygments.styles' FILTER_ENTRY_POINT = 'pygments.filters' + def iter_entry_points(group_name): try: import pkg_resources - except ImportError: + except (ImportError, IOError): return [] return pkg_resources.iter_entry_points(group_name) + def find_plugin_lexers(): for entrypoint in iter_entry_points(LEXER_ENTRY_POINT): yield entrypoint.load() |