فهرست منبع

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();