py3: ported Part to python3
This commit is contained in:
@@ -412,10 +412,17 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
|
||||
// use no kwds
|
||||
PyObject* dist_or_num;
|
||||
if (PyArg_ParseTuple(args, "O", &dist_or_num)) {
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
if (PyLong_Check(dist_or_num)) {
|
||||
numPoints = PyLong_AsLong(dist_or_num);
|
||||
uniformAbscissaPoints = true;
|
||||
}
|
||||
#else
|
||||
if (PyInt_Check(dist_or_num)) {
|
||||
numPoints = PyInt_AsLong(dist_or_num);
|
||||
uniformAbscissaPoints = true;
|
||||
}
|
||||
#endif
|
||||
else if (PyFloat_Check(dist_or_num)) {
|
||||
distance = PyFloat_AsDouble(dist_or_num);
|
||||
uniformAbscissaDistance = true;
|
||||
|
||||
Reference in New Issue
Block a user