Skip to content

Commit

Permalink
Remove compatibility with unsupported Python versions (#146)
Browse files Browse the repository at this point in the history
Also fix typing of `pattern`
  • Loading branch information
Viicos authored Jan 31, 2024
1 parent 237ccbd commit e4c6700
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
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
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 e4c6700

Please sign in to comment.