Handle OSError when checking for is_file (#215)

This commit is contained in:
Matteo Destro 2024-10-13 09:08:03 +02:00 committed by GitHub
parent a88487ff25
commit bf8d9c96e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3198,7 +3198,11 @@ class Worker(ServiceCommandSection):
execution.working_dir = execution.working_dir or "."
# fix our import patch (in case we have __future__)
if script_file and script_file.is_file():
try:
is_file = script_file and script_file.is_file()
except OSError:
is_file = False
if is_file:
fix_package_import_diff_patch(script_file.as_posix())
if is_literal_script and not has_repository: