Skip to content

Commit

Permalink
Drop compatibility for unsupported Python Version (#147)
Browse files Browse the repository at this point in the history
Drop compatibility for unsupported Python Version (8.0.3)
----

Co-authored-by: Viicos <[email protected]>
  • Loading branch information
un33k and Viicos authored Jan 31, 2024
1 parent e52c35e commit 26b81c2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## Work in progress
## 8.0.3

- Drop compatibility for unsupported Python Version (@Viicos - thx)
- Fix pattern types.

## 8.0.2

Expand Down
2 changes: 1 addition & 1 deletion slugify/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import absolute_import, annotations, print_function
from __future__ import annotations

import argparse
import sys
Expand Down
2 changes: 1 addition & 1 deletion slugify/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
__url__ = 'https://github.com/un33k/python-slugify'
__license__ = 'MIT'
__copyright__ = 'Copyright 2022 Val Neekman @ Neekware Inc.'
__version__ = '8.0.2'
__version__ = '8.0.3'
6 changes: 1 addition & 5 deletions slugify/slugify.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import re
import sys
import unicodedata
from collections.abc import Iterable
from html.entities import name2codepoint
Expand Down Expand Up @@ -83,7 +82,7 @@ def slugify(
separator: str = DEFAULT_SEPARATOR,
save_order: bool = False,
stopwords: Iterable[str] = (),
regex_pattern: str | None = None,
regex_pattern: re.Pattern[str] | str | None = None,
lowercase: bool = True,
replacements: Iterable[Iterable[str]] = (),
allow_unicode: bool = False,
Expand Down Expand Up @@ -153,9 +152,6 @@ def slugify(
else:
text = unicodedata.normalize('NFKD', text)

if sys.version_info < (3,):
text = text.encode('ascii', 'ignore')

# make the text lowercase (optional)
if lowercase:
text = text.lower()
Expand Down

0 comments on commit 26b81c2

Please sign in to comment.