@@ -34,8 +34,7 @@ def find_7zip_executable() -> str:
3434 Path (sys .prefix ).parent / "t" ,
3535 ]
3636 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 ():
3938 return str (executable_path )
4039 raise RuntimeError ("7ZIP is not installed on this computer." )
4140
@@ -180,9 +179,8 @@ def __init__(
180179
181180 def _get_python_zip_file (self ) -> Path :
182181 """Finds the Python .zip file in the wheels directory."""
183- pattern = r"(pypy3|python-)([0-9]|[a-zA-Z]|.)*.zip"
184182 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 ):
186184 return self .wheels_directory / filename
187185 raise RuntimeError (f"Could not find Python zip package in { self .wheels_directory } " )
188186
@@ -305,8 +303,7 @@ def pre_path_entries(self) -> list[str]:
305303 @property
306304 def documentation_directories_list (self ) -> list [Path ]:
307305 """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 ():
310307 return [default_docs_directory ] + self .documentation_directories
311308 return self .documentation_directories
312309
@@ -371,7 +368,7 @@ def _copy_essential_files(self):
371368
372369 tools_target_directory = self .winpython_directory / "t"
373370 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 )
375372
376373 # Special handling for Node.js to move it up one level
377374 nodejs_current_directory = tools_target_directory / "n"
0 commit comments