bpo-40280: Change subprocess imports for cleaner error on wasm32 (GH-30620) by tiran · Pull Request #30620 · python/cpython

I won't push for a revert yet, but I also wouldn't like to see this version in a final release.

I'm afraid there's not a perfect solution here: the behavior should be based on what can be imported, which means at least one platform is going to have to raise and handle a ModuleNotFoundError. We could go a little crazy and guess at which imports should be tried first based on sys.platform (or 'msvcrt' in sys.builtin_module_names?), but I'm not sure how much effort it's worth to avoid the exception.

What was the exception when both are missing, and how was it confusing?