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 | afcaa7d6ac6c676501446efa6f1a7de0d4eae86c (patch) | |
tree | 75405413cd47d81a22e008c082ebf5fdbb86b8e6 | |
parent | 316de655ae462390ace8b7fe0baebd8f98d0a0e8 (diff) | |
download | pygments-afcaa7d6ac6c676501446efa6f1a7de0d4eae86c.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() |