@@ -34,8 +34,7 @@ def find_7zip_executable() -> str:
34
34
Path (sys .prefix ).parent / "t" ,
35
35
]
36
36
for base_dir in possible_program_files :
37
- executable_path = base_dir / "7-Zip" / "7z.exe"
38
- if executable_path .is_file ():
37
+ if (executable_path := base_dir / "7-Zip" / "7z.exe" ).is_file ():
39
38
return str (executable_path )
40
39
raise RuntimeError ("7ZIP is not installed on this computer." )
41
40
@@ -180,9 +179,8 @@ def __init__(
180
179
181
180
def _get_python_zip_file (self ) -> Path :
182
181
"""Finds the Python .zip file in the wheels directory."""
183
- pattern = r"(pypy3|python-)([0-9]|[a-zA-Z]|.)*.zip"
184
182
for filename in os .listdir (self .wheels_directory ):
185
- if re .match (pattern , filename ):
183
+ if re .match ("(pypy3|python-)([0-9]|[a-zA-Z]|.)*.zip" , filename ):
186
184
return self .wheels_directory / filename
187
185
raise RuntimeError (f"Could not find Python zip package in { self .wheels_directory } " )
188
186
@@ -305,8 +303,7 @@ def pre_path_entries(self) -> list[str]:
305
303
@property
306
304
def documentation_directories_list (self ) -> list [Path ]:
307
305
"""Returns the list of documentation directories to include."""
308
- default_docs_directory = Path (__file__ ).resolve ().parent / "docs"
309
- if default_docs_directory .is_dir ():
306
+ if (default_docs_directory := Path (__file__ ).parent / "docs" ).is_dir ():
310
307
return [default_docs_directory ] + self .documentation_directories
311
308
return self .documentation_directories
312
309
@@ -371,7 +368,7 @@ def _copy_essential_files(self):
371
368
372
369
tools_target_directory = self .winpython_directory / "t"
373
370
self ._print_action (f"Copying tools to { tools_target_directory } " )
374
- _copy_items (self .tools_directories , self . winpython_directory / "t" , self .verbose )
371
+ _copy_items (self .tools_directories , tools_target_directory , self .verbose )
375
372
376
373
# Special handling for Node.js to move it up one level
377
374
nodejs_current_directory = tools_target_directory / "n"
0 commit comments