Skip to content

Instantly share code, notes, and snippets.

@iMichka
Last active December 2, 2021 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iMichka/4ea358b055b9bfdb6e92cd31af9b4fcd to your computer and use it in GitHub Desktop.
Save iMichka/4ea358b055b9bfdb6e92cd31af9b4fcd to your computer and use it in GitHub Desktop.
markdown
diff --git a/markdown/util.py b/markdown/util.py
index b443e3792..98cfbf754 100644
--- a/markdown/util.py
+++ b/markdown/util.py
@@ -29,10 +29,10 @@
from .pep562 import Pep562
-try:
+if sys.version_info >= (3, 10):
from importlib import metadata
-except ImportError:
- # <PY38 use backport
+else:
+ # <PY310 use backport
import importlib_metadata as metadata
PY37 = (3, 7) <= sys.version_info
@@ -85,7 +85,7 @@
"""
# Only load extension entry_points once.
-INSTALLED_EXTENSIONS = metadata.entry_points().get('markdown.extensions', ())
+INSTALLED_EXTENSIONS = metadata.entry_points(group='markdown.extensions')
RTL_BIDI_RANGES = (
('\u0590', '\u07FF'),
# Hebrew (0590-05FF), Arabic (0600-06FF),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment