Skip to content

Commit d7f9dce

Browse files
committed
address review
1 parent 8c75068 commit d7f9dce

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Lib/platform.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,7 @@ def system_alias(system, release, version):
613613
### Various internal helpers
614614

615615
# Table for cleaning up characters in filenames.
616-
_SIMPLE_SUBSTITUTIONS = (
617-
dict.fromkeys(map(ord, '/\\:;"()'), '-') | {ord(' '): '_'}
618-
)
616+
_SIMPLE_SUBSTITUTIONS = str.maketrans(r' /\:;"()', r'_-------')
619617

620618
def _platform(*args):
621619

@@ -632,7 +630,7 @@ def _platform(*args):
632630
platform = platform.replace('unknown', '')
633631

634632
# Fold '--'s and remove trailing '-'
635-
return re.sub(r'-+', '-', platform).rstrip('-')
633+
return re.sub(r'-{2,}', '-', platform).rstrip('-')
636634

637635
def _node(default=''):
638636

Misc/NEWS.d/next/Library/2025-06-28-11-12-12.gh-issue-136066.WqsKka.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)