add exception to Timeout Error (#963)

When timeout connecting, you get URLError: <urlopen error timed out>, In that case, build it from source.
This commit is contained in:
Corey James Levinson 2024-05-26 15:33:03 -04:00 committed by GitHub
parent 22339db185
commit beb8b8ba9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -282,7 +282,7 @@ class CachedWheelsCommand(_bdist_wheel):
wheel_path = os.path.join(self.dist_dir, archive_basename + ".whl")
print("Raw wheel path", wheel_path)
os.rename(wheel_filename, wheel_path)
except urllib.error.HTTPError:
except (urllib.error.HTTPError, urllib.error.URLError):
print("Precompiled wheel not found. Building from source...")
# If the wheel could not be downloaded, build from source
super().run()