diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 31207efb..5c2d1f0a 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -174,6 +174,8 @@ def setup_setuptools_cross_compile( f"Unable to configure setuptools for cross-compiling because {distutils_cfg} is a directory" ) return + else: + atexit.register(lambda: distutils_cfg.unlink) # Ensure our additional import libraries are made available, and explicitly # set the platform name @@ -183,6 +185,8 @@ def setup_setuptools_cross_compile( distutils_cfg.write_text( textwrap.dedent( f"""\ + # I am a temporary configuration file generated by cibuildwheel. + # Please remove me or I will likely break your other builds. [build] plat_name={plat_name} [build_ext]