| 11 | |
| 12 | # Patch sys.modules to fake missing modules from numpy 2.x |
| 13 | class FakeModule(ModuleType): |
| 14 | def __init__(self, name, real=None): |
| 15 | super().__init__(name) |
| 16 | if real: |
| 17 | self.__dict__.update(real.__dict__) |
| 18 | |
| 19 | # Patch potentially missing modules |
| 20 | sys.modules['numpy._core'] = FakeModule('numpy._core', np.core if hasattr(np, 'core') else np) |