diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-06-06 12:14:07 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-06-07 14:52:10 +0200 |
| commit | f7ba2bb385728db31a92c27883a53763196a8f35 (patch) | |
| tree | 1c7e054c12b1002470a6100cfcdd8118ac41dbeb | |
| parent | c7c7dc9ba6da83f26d2ecda33a9af58d3f8f5f20 (diff) | |
Lazy Load: Disable lazy for PyPy
Pick-to: 6.7
Task-number: PYSIDE-535
Task-number: PYSIDE-2404
Change-Id: I6d05e73457de7d12213bf9b046359355fcb0a941
Reviewed-by: Christian Tismer <tismer@stackless.com>
| -rw-r--r-- | sources/shiboken6/libshiboken/sbkmodule.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sources/shiboken6/libshiboken/sbkmodule.cpp b/sources/shiboken6/libshiboken/sbkmodule.cpp index c27cde3b8..63c71e618 100644 --- a/sources/shiboken6/libshiboken/sbkmodule.cpp +++ b/sources/shiboken6/libshiboken/sbkmodule.cpp @@ -331,11 +331,22 @@ static bool shouldLazyLoad(PyObject *module) return std::strncmp(modName, "PySide6.", 8) == 0; } +static int lazyLoadDefault() +{ +#ifndef PYPY_VERSION + int result = 1; +#else + int result = 0; +#endif + if (auto *flag = getenv("PYSIDE6_OPTION_LAZY")) + result = std::atoi(flag); + return result; +} + void checkIfShouldLoadImmediately(PyObject *module, const std::string &name, const NameToTypeFunctionMap &nameToFunc) { - static const char *flag = getenv("PYSIDE6_OPTION_LAZY"); - static const int value = flag != nullptr ? std::atoi(flag) : 1; + static const int value = lazyLoadDefault(); // PYSIDE-2404: Lazy Loading // |
