summaryrefslogtreecommitdiff
path: root/pygments/plugin.py
diff options
context:
space:
mode:
authorAnteru <bitbucket@ca.sh13.net>2018-11-24 16:37:08 +0000
committerAnteru <bitbucket@ca.sh13.net>2018-11-24 16:37:08 +0000
commitd13cb73dc075a689f17e453a392429eb880b2eca (patch)
tree0080f4e9f88ac2606d7409d05ac558d949eb22d4 /pygments/plugin.py
parentdc5b32f193fffada482963a52f6b6bce3bc5f5b9 (diff)
parent8408c47750e2f97282ed45827c1c45e4a31d7b78 (diff)
downloadpygments-git-d13cb73dc075a689f17e453a392429eb880b2eca.tar.gz
Merged in hroncok/pygments-main/py37 (pull request #772)
PEP 479: Raising StopIteration from a generator is now an error Approved-by: Anteru <bitbucket@ca.sh13.net>
Diffstat (limited to 'pygments/plugin.py')
-rw-r--r--pygments/plugin.py4
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()