aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/libshiboken/sbkfeature_base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/libshiboken/sbkfeature_base.cpp')
-rw-r--r--sources/shiboken6/libshiboken/sbkfeature_base.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/sources/shiboken6/libshiboken/sbkfeature_base.cpp b/sources/shiboken6/libshiboken/sbkfeature_base.cpp
index 41e2aaa5b..906df8e19 100644
--- a/sources/shiboken6/libshiboken/sbkfeature_base.cpp
+++ b/sources/shiboken6/libshiboken/sbkfeature_base.cpp
@@ -12,6 +12,8 @@
#include "sbkfeature_base.h"
#include "gilstate.h"
+#include <cctype>
+
using namespace Shiboken;
extern "C"
@@ -199,6 +201,9 @@ static PyObject *lookupUnqualifiedOrOldEnum(PyTypeObject *type, PyObject *name)
// MRO has been observed to be 0 in case of errors with QML decorators
if (type == nullptr || type->tp_mro == nullptr)
return nullptr;
+ // Quick Check: Avoid "__..", "_slots", etc.
+ if (std::isalpha(Shiboken::String::toCString(name)[0]) == 0)
+ return nullptr;
static PyTypeObject *const EnumMeta = getPyEnumMeta();
static PyObject *const _member_map_ = String::createStaticString("_member_map_");
// This is similar to `find_name_in_mro`, but instead of looking directly into