aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-02-01 15:59:18 +0100
committerCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-02-05 23:00:23 +0100
commit5e8e3591e09c14cb65c4089b3706fcbcbe84f8eb (patch)
treebd8a61ea388fae6a9dcc6b70ab310d9d0c761011
parent253ff4e611e10794bbd63d6a12fba194a7ac8b54 (diff)
feature: Fix a flag error when no snake_case is selected
This is another small bug that was found by testing true_property alone. Some flag refactoring forgot to mask the flag. Change-Id: Id3576cf982451b022a8ace72fbaf4369d32b6cb1 Task-number: PYSIDE-1019 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit cdb644bc8fde3086996d4ecaba06f8c34d7666a3) Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--sources/shiboken2/libshiboken/bindingmanager.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/sources/shiboken2/libshiboken/bindingmanager.cpp b/sources/shiboken2/libshiboken/bindingmanager.cpp
index 78c03556c..065c02049 100644
--- a/sources/shiboken2/libshiboken/bindingmanager.cpp
+++ b/sources/shiboken2/libshiboken/bindingmanager.cpp
@@ -299,12 +299,13 @@ PyObject *BindingManager::getOverride(const void *cptr,
// They cannot be overridden (make that sure by the metaclass).
return nullptr;
}
- PyObject *pyMethodName = nameCache[(flag & 1) != 0]; // borrowed
+ bool is_snake = flag & 0x01;
+ PyObject *pyMethodName = nameCache[is_snake]; // borrowed
if (pyMethodName == nullptr) {
if (propFlag)
methodName += 2; // skip the propFlag and ':'
- pyMethodName = Shiboken::String::getSnakeCaseName(methodName, flag);
- nameCache[(flag & 1) != 0] = pyMethodName;
+ pyMethodName = Shiboken::String::getSnakeCaseName(methodName, is_snake);
+ nameCache[is_snake] = pyMethodName;
}
if (wrapper->ob_dict) {