소스 검색

HPCC-24552 REGRESSION: pyembed: _new_() takes 2 positional arguments but 6 were given

Affects Python 3.6 systems only. Using ACTIVITY mode on a python embed will
fail.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 4 년 전
부모
커밋
5ff72c69ae
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      plugins/py3embed/py3embed.cpp

+ 6 - 0
plugins/py3embed/py3embed.cpp

@@ -1639,7 +1639,13 @@ public:
         PyTuple_SET_ITEM((PyTupleObject *) args.get(), 2, PyLong_FromLong(ctx->numStrands()));
         PyTuple_SET_ITEM((PyTupleObject *) args.get(), 3, PyLong_FromLong(ctx->querySlave()));
         PyTuple_SET_ITEM((PyTupleObject *) args.get(), 4, PyLong_FromLong(ctx->queryStrand()));
+#ifdef USE_CUSTOM_NAMEDTUPLES
+        OwnedPyObject argsTuple = PyTuple_New(1);
+        PyTuple_SET_ITEM((PyTupleObject *) argsTuple.get(), 0, args.getClear());
+        OwnedPyObject activityTuple = PyObject_CallObject(mynamedtupletype, argsTuple);  // Creates a namedtuple from the supplied tuple
+#else
         OwnedPyObject activityTuple = PyObject_CallObject(mynamedtupletype, args);  // Creates a namedtuple from the supplied tuple
+#endif
         checkPythonError();
         PyDict_SetItemString(locals, "__activity__", activityTuple.getClear());
         checkPythonError();