Skip to content

Commit 41776ce

Browse files
committed
Minor hardening for Windows CI workers
1 parent e623f32 commit 41776ce

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

graalpython/com.oracle.graal.python.test/src/tests/test_patched_pip.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ def build_package(self, name, version):
153153

154154
def add_package_to_index(self, name, version, dist_type):
155155
package = self.build_package(name, version)[dist_type]
156-
shutil.copy(package, self.index_dir)
156+
# extra careful, not using shutil.copy so we get more detailed traceback
157+
# on some flaky windows CI workers
158+
self.assertTrue(package.exists(), f"Built package disappeared: {package}")
159+
destination = self.index_dir / package.name
160+
with open(package, 'rb') as src, open(destination, 'wb') as dst:
161+
shutil.copyfileobj(src, dst)
157162

158163
def run_venv_pip_install(self, package, extra_env=None, assert_stderr_matches=None):
159164
env = self.pip_env.copy()

0 commit comments

Comments
 (0)