diff --git a/cibuildwheel/util/python_build_standalone.py b/cibuildwheel/util/python_build_standalone.py index 24a23556..f8dca73c 100644 --- a/cibuildwheel/util/python_build_standalone.py +++ b/cibuildwheel/util/python_build_standalone.py @@ -175,7 +175,9 @@ def create_python_build_standalone_environment( ) python_base_dir = temp_dir / "pbs" - assert not python_base_dir.exists() + if python_base_dir.exists(): + msg = f"python-build-standalone directory already exists: {python_base_dir}" + raise PythonBuildStandaloneError(msg) extract_tar(archive_path, python_base_dir) return _find_python_executable(python_base_dir)