Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove compatibility with unsupported Python versions (#146)
Also fix typing of `pattern`
  • Loading branch information
Viicos authored Jan 31, 2024
commit e4c670027755098a2b63b5ee5390b385cc6cf927
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