Skip to content

Commit 72e4d9f

Browse files
committed
Python 3.13: Fix Deprecation Warnings
Fixes "DeprecationWarning: 'count' is passed as positional argument" on regular expression functions. These seemingly were intended to be passed as flags, not as count anyway.
1 parent 5732f70 commit 72e4d9f

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

Patches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2641,7 +2641,7 @@ def create_fake_name(name: str) -> str:
26412641
# keeping the game E...
26422642
new_name = ''.join(list_name)
26432643
censor = ['cum', 'cunt', 'dike', 'penis', 'puss', 'rape', 'shit']
2644-
new_name_az = re.sub(r'[^a-zA-Z]', '', new_name.lower(), re.UNICODE)
2644+
new_name_az = re.sub(r'[^a-zA-Z]', '', new_name.lower())
26452645
for cuss in censor:
26462646
if cuss in new_name_az:
26472647
return create_fake_name(name)

Settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def get_numeric_seed(self) -> int:
243243

244244
def sanitize_seed(self) -> None:
245245
# leave only alphanumeric and some punctuation
246-
self.seed = re.sub(r'[^a-zA-Z0-9_-]', '', self.seed, re.UNICODE)
246+
self.seed = re.sub(r'[^a-zA-Z0-9_-]', '', self.seed)
247247

248248
def update_seed(self, seed: str) -> None:
249249
if seed is None or seed == '':

Utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ class VersionError(Exception):
125125

126126
def check_version(checked_version: str) -> None:
127127
if not hasattr(check_version, "base_regex"):
128-
check_version.base_regex = re.compile("""^[ \t]*__version__ = ['"](.+)['"]""", re.MULTILINE)
129-
check_version.supplementary_regex = re.compile(r"^[ \t]*supplementary_version = (\d+)$", re.MULTILINE)
130-
check_version.full_regex = re.compile("""^[ \t]*__version__ = f['"]*(.+)['"]""", re.MULTILINE)
131-
check_version.url_regex = re.compile("""^[ \t]*branch_url = ['"](.+)['"]""", re.MULTILINE)
128+
check_version.base_regex = re.compile("""^[ \t]*__version__ = ['"](.+)['"]""", flags=re.MULTILINE)
129+
check_version.supplementary_regex = re.compile(r"^[ \t]*supplementary_version = (\d+)$", flags=re.MULTILINE)
130+
check_version.full_regex = re.compile("""^[ \t]*__version__ = f['"]*(.+)['"]""", flags=re.MULTILINE)
131+
check_version.url_regex = re.compile("""^[ \t]*branch_url = ['"](.+)['"]""", flags=re.MULTILINE)
132132

133133
if compare_version(checked_version, __version__) < 0:
134134
try:

0 commit comments

Comments
 (0)