Skip to content

Commit

Permalink
Fixed SyntaxWarning in subzero language enforced in Python 3.12. #2656
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Sep 22, 2024
1 parent 115926d commit 14a361d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions custom_libs/subzero/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,4 @@ def fromalpha3b(cls, s):
return Language(*Language_.fromalpha3b(s).__getstate__())


IETF_MATCH = ".+\.([^-.]+)(?:-[A-Za-z]+)?$"
ENDSWITH_LANGUAGECODE_RE = re.compile("\.([^-.]{2,3})(?:-[A-Za-z]{2,})?$")


def match_ietf_language(s, ietf=False):
language_match = re.match(".+\.([^\.]+)$" if not ietf
else IETF_MATCH, s)
if language_match and len(language_match.groups()) == 1:
language = language_match.groups()[0]
return language
return s
ENDSWITH_LANGUAGECODE_RE = re.compile(r"\.([^-.]{2,3})(?:-[A-Za-z]{2,})?$")

0 comments on commit 14a361d

Please sign in to comment.