Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2142

passing cpp exported enum to cpp function as param (from python) prints error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.5.0, 6.4.2
    • 6.4.0.1
    • Shiboken
    • None
    • All
    • 340e9bfb2 (dev), 8dc6fa902 (6.4)

      whenever i pass exported enum to some cpp exported function from python the error prints - it works but it spams console like crazy

       

      the problem is with file that is located here: "pyside-setup/sources/shiboken6/libshiboken/sbkenum.cpp"

      in the function:

      EnumValueType getValue(PyObject *enumItem)
      {
          init_enum();
      
          assert(Enum::check(enumItem));
      
          // PYSIDE-1735: Decide dynamically if new or old enums will be used.
          if (useOldEnum)
              return reinterpret_cast<SbkEnumObject *>(enumItem)->ob_value;
      
          std::cerr << __FUNCTION__ << ' ' << Shiboken::debugPyObject(enumItem)
                    << " err=" << Shiboken::debugPyObject(PyErr_Occurred()) << '\n';
      
          AutoDecRef pyValue(PyObject_GetAttrString(enumItem, "value"));
          return PyLong_AsLongLong(pyValue);}
      

      the std:cerr is always executing - either remove it or check if really any error occured.

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kleint Friedemann Kleint
            meomic Michal M
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes