We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 586d3bf commit 4d77ba4Copy full SHA for 4d77ba4
src/ptscripts/virtualenv.py
@@ -232,7 +232,16 @@ def __enter__(self) -> VirtualEnv:
232
except subprocess.CalledProcessError:
233
msg = "Failed to create virtualenv"
234
raise AssertionError(msg) from None
235
- self._install_requirements()
+ try:
236
+ self._install_requirements()
237
+ except FileNotFoundError:
238
+ # attempt to fix the virtualenv. delete and start over
239
+ shutil.rmtree(str(self.venv_dir))
240
241
+ self._create_virtualenv()
242
+ except subprocess.CalledProcessError:
243
+ msg = "Failed to create virtualenv"
244
+ raise AssertionError(msg) from None
245
self._add_as_extra_site_packages()
246
return self
247
0 commit comments