pyConvertBackInt function Null safety

int pyConvertBackInt (
  1. Pointer<PyObject> o
)

Converts a python int to a dart int

Implementation

int pyConvertBackInt(Pointer<PyObject> o) {
  final res = dartpyc.PyLong_AsLong(o);
  if (!pyErrOccurred()) {
    dartpyc.Py_DecRef(o);
    return res;
  }
  throw DartPyException('Error in converting back to an int');
}