Skip to content

Commit c6d623a

Browse files
committed
do not adjust for self if a templated method is static
1 parent c70bee8 commit c6d623a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/TemplateProxy.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ PyObject* TemplateProxy::Instantiate(const std::string& fname,
7676
std::string proto = "";
7777

7878
#if PY_VERSION_HEX >= 0x03080000
79-
// adjust arguments for self if this is a rebound global function
79+
// adjust arguments for self if this is a rebound (global) function
8080
bool isNS = (((CPPScope*)fTI->fPyClass)->fFlags & CPPScope::kIsNamespace);
81-
if (!isNS && !fSelf && CPyCppyy_PyArgs_GET_SIZE(args, nargsf)) {
81+
if (!isNS && CPyCppyy_PyArgs_GET_SIZE(args, nargsf) && \
82+
(!fSelf ||
83+
(fSelf == Py_None && !Cppyy::IsStaticTemplate(((CPPScope*)fTI->fPyClass)->fCppType, fname)))) {
8284
args += 1;
8385
nargsf -= 1;
8486
}

0 commit comments

Comments
 (0)