summaryrefslogtreecommitdiff
path: root/pygments/plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/plugin.py')
-rw-r--r--pygments/plugin.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pygments/plugin.py b/pygments/plugin.py
index 7987d646..3d185efc 100644
--- a/pygments/plugin.py
+++ b/pygments/plugin.py
@@ -32,7 +32,7 @@
yourfilter = yourfilter:YourFilter
- :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
LEXER_ENTRY_POINT = 'pygments.lexers'
@@ -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()