diff --git a/docs/users/changelog.md b/docs/users/changelog.md index 9e4c78a..4d23390 100644 --- a/docs/users/changelog.md +++ b/docs/users/changelog.md @@ -5,6 +5,8 @@ Note that there is currently no guarantee for a stable Markdown formatting style ## **unreleased** +- Removed + - `mdformat.codepoints.ASCII_WHITESPACE` (deprecated since 0.7.20) - Fixed - Read UTF-8 from standard input on all systems. Thank you, [Christopher Prohm](https://github.com/chmp), for the PR. diff --git a/src/mdformat/codepoints/__init__.py b/src/mdformat/codepoints/__init__.py index 0491ae6..023e674 100644 --- a/src/mdformat/codepoints/__init__.py +++ b/src/mdformat/codepoints/__init__.py @@ -2,7 +2,6 @@ "UNICODE_PUNCTUATION", "UNICODE_WHITESPACE", "ASCII_CTRL", - "ASCII_WHITESPACE", ) @@ -10,23 +9,3 @@ from mdformat.codepoints._unicode_whitespace import UNICODE_WHITESPACE ASCII_CTRL = frozenset(chr(i) for i in range(32)) | frozenset(chr(127)) - - -def __getattr__(name: str) -> frozenset[str]: - """Attribute getter fallback. - - Used during the deprecation period of `ASCII_WHITESPACE`. - """ - if name == "ASCII_WHITESPACE": - import warnings - - warnings.warn( - "ASCII_WHITESPACE is deprecated because CommonMark v0.30 no longer " - "defines ASCII whitespace.", - DeprecationWarning, - stacklevel=2, - ) - return frozenset({chr(9), chr(10), chr(11), chr(12), chr(13), chr(32)}) - raise AttributeError( - f"module {__name__!r} has no attribute {name!r}" - ) # pragma: no cover diff --git a/tests/test_api.py b/tests/test_api.py index a7c58e0..73177d7 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -143,11 +143,6 @@ def test_mdrenderer_no_finalize(tmp_path): assert finalized == unfinalized + "\n\n[gl ref]: https://gitlab.com\n" -def test_ascii_whitespace_deprecation(): - with pytest.warns(DeprecationWarning): - mdformat.codepoints.ASCII_WHITESPACE - - def test_import_typing(): """Try to import mdformat.renderer.typing.