Skip to content

Commit 26b81c2

Browse files
un33kViicos
andauthored
Drop compatibility for unsupported Python Version (#147)
Drop compatibility for unsupported Python Version (8.0.3) ---- Co-authored-by: Viicos <65306057+Viicos@users.noreply.github.com>
1 parent e52c35e commit 26b81c2

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
## Work in progress
1+
## 8.0.3
2+
3+
- Drop compatibility for unsupported Python Version (@Viicos - thx)
4+
- Fix pattern types.
25

36
## 8.0.2
47

slugify/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from __future__ import absolute_import, annotations, print_function
1+
from __future__ import annotations
22

33
import argparse
44
import sys

slugify/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
__url__ = 'https://github.com/un33k/python-slugify'
66
__license__ = 'MIT'
77
__copyright__ = 'Copyright 2022 Val Neekman @ Neekware Inc.'
8-
__version__ = '8.0.2'
8+
__version__ = '8.0.3'

slugify/slugify.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import re
4-
import sys
54
import unicodedata
65
from collections.abc import Iterable
76
from html.entities import name2codepoint
@@ -83,7 +82,7 @@ def slugify(
8382
separator: str = DEFAULT_SEPARATOR,
8483
save_order: bool = False,
8584
stopwords: Iterable[str] = (),
86-
regex_pattern: str | None = None,
85+
regex_pattern: re.Pattern[str] | str | None = None,
8786
lowercase: bool = True,
8887
replacements: Iterable[Iterable[str]] = (),
8988
allow_unicode: bool = False,
@@ -153,9 +152,6 @@ def slugify(
153152
else:
154153
text = unicodedata.normalize('NFKD', text)
155154

156-
if sys.version_info < (3,):
157-
text = text.encode('ascii', 'ignore')
158-
159155
# make the text lowercase (optional)
160156
if lowercase:
161157
text = text.lower()

0 commit comments

Comments
 (0)