From 040b617a0dfed0f647582fffee5b0f3f64447184 Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Thu, 2 Nov 2023 17:54:43 +0100 Subject: [PATCH] Remove legacy import needed only in Python 2 --- docs/changelog.md | 1 + markdown/inlinepatterns.py | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 6f40a6bf..62f47ac7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fix type annotations for `convertFile` - it accepts only bytes-based buffers. Also remove legacy checks from Python 2 (#1400) +* Remove legacy import needed only in Python 2 (#1403) * Improve and expand type annotations in the code base (#1401). ## [3.5.1] -- 2023-10-31 diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py index ef6f0fbc..3d366ad9 100644 --- a/markdown/inlinepatterns.py +++ b/markdown/inlinepatterns.py @@ -44,10 +44,7 @@ from typing import TYPE_CHECKING, Any, Collection, NamedTuple import re import xml.etree.ElementTree as etree -try: # pragma: no cover - from html import entities -except ImportError: # pragma: no cover - import htmlentitydefs as entities +from html import entities if TYPE_CHECKING: # pragma: no cover from markdown import Markdown