I've run into a weird case of incompatibility between:
- A Python module (
PySide6
) that bundles its own version of the Visual C++ runtime - Our own compiled modules that are compiled against the latest Visual C++ runtime
At some point we upgraded Visual C++, and the second ended up being newer than the first, meaning that according to MS Visual C++ compatibility rules:
- Importing
PySide6
, then our module makes the interpreter crash: by default our module tries to reuse the old runtime version already loaded fromPySide6
, and that configuration is not supported because it's compiled for a newer runtime. - Importing our module, then
PySide6
works perfectly fine: our module uses the newer system runtime andPySide6
keeps on using its custom runtime, both configurations being supported.
Aside from doing the same thing as PySide6
(bundling the runtime inside of our module) or forcing our module to load the system runtime manually, is there a way to detect that this is happening before the import and warn/crash with a proper error message?