8000 gh-89745: Avoid exact match when comparing program_name in test_embed on Windows by neonene · Pull Request #93888 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-89745: Avoid exact match when comparing program_name in test_embed on Windows #93888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 17, 2022
Merged
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
no regex
  • Loading branch information
neonene authored Jun 16, 2022
commit 383a32740810c9619da9ef925ee6901519ed32ea
6 changes: 3 additions & 3 deletions Lib/test/test_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,10 @@ def check_pre_config(self, configs, expected):
def check_config(self, configs, expected):
config = dict(configs['config'])
if MS_WINDOWS:
value = config.get('program_name')
value = config.get(key := 'program_name')
if value and isinstance(value, str):
ptn = r'_d\.exe$' if debug_build(sys.executable) else r'\.exe$'
config['program_name'] = re.sub(ptn, '', value, 1, re.IGNORECASE)
ext = '_d.exe' if debug_build(sys.executable) else '.exe'
config[key] = value[:len(value.lower().removesuffix(ext))]
for key, value in list(expected.items()):
if value is self.IGNORE_CONFIG:
config.pop(key, None)
Expand Down
0