Skip to content

Commit 6e9d717

Browse files
committed
Remove ASCII_WHITESPACE
1 parent ae503ee commit 6e9d717

File tree

3 files changed

+2
-26
lines changed

3 files changed

+2
-26
lines changed

docs/users/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Note that there is currently no guarantee for a stable Markdown formatting style
55

66
## **unreleased**
77

8+
- Removed
9+
- `mdformat.codepoints.ASCII_WHITESPACE` (deprecated since 0.7.20)
810
- Fixed
911
- Read UTF-8 from standard input on all systems.
1012
Thank you, [Christopher Prohm](https://github.com/chmp), for the PR.

src/mdformat/codepoints/__init__.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,10 @@
22
"UNICODE_PUNCTUATION",
33
"UNICODE_WHITESPACE",
44
"ASCII_CTRL",
5-
"ASCII_WHITESPACE",
65
)
76

87

98
from mdformat.codepoints._unicode_punctuation import UNICODE_PUNCTUATION
109
from mdformat.codepoints._unicode_whitespace import UNICODE_WHITESPACE
1110

1211
ASCII_CTRL = frozenset(chr(i) for i in range(32)) | frozenset(chr(127))
13-
14-
15-
def __getattr__(name: str) -> frozenset[str]:
16-
"""Attribute getter fallback.
17-
18-
Used during the deprecation period of `ASCII_WHITESPACE`.
19-
"""
20-
if name == "ASCII_WHITESPACE":
21-
import warnings
22-
23-
warnings.warn(
24-
"ASCII_WHITESPACE is deprecated because CommonMark v0.30 no longer "
25-
"defines ASCII whitespace.",
26-
DeprecationWarning,
27-
stacklevel=2,
28-
)
29-
return frozenset({chr(9), chr(10), chr(11), chr(12), chr(13), chr(32)})
30-
raise AttributeError(
31-
f"module {__name__!r} has no attribute {name!r}"
32-
) # pragma: no cover

tests/test_api.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,6 @@ def test_mdrenderer_no_finalize(tmp_path):
143143
assert finalized == unfinalized + "\n\n[gl ref]: https://gitlab.com\n"
144144

145145

146-
def test_ascii_whitespace_deprecation():
147-
with pytest.warns(DeprecationWarning):
148-
mdformat.codepoints.ASCII_WHITESPACE
149-
150-
151146
def test_import_typing():
152147
"""Try to import mdformat.renderer.typing.
153148

0 commit comments

Comments
 (0)