py3: ported Path to python3
This commit is contained in:
@@ -112,9 +112,9 @@ Py::Float PathPy::getLength(void) const
|
||||
return Py::Float(getToolpathPtr()->getLength());
|
||||
}
|
||||
|
||||
Py::Int PathPy::getSize(void) const
|
||||
Py::Long PathPy::getSize(void) const
|
||||
{
|
||||
return Py::Int((int)getToolpathPtr()->getSize());
|
||||
return Py::Long((long)getToolpathPtr()->getSize());
|
||||
}
|
||||
|
||||
// specific methods
|
||||
@@ -178,7 +178,11 @@ PyObject* PathPy::toGCode(PyObject * args)
|
||||
{
|
||||
if (PyArg_ParseTuple(args, "")) {
|
||||
std::string result = getToolpathPtr()->toGCode();
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
return PyBytes_FromString(result.c_str());
|
||||
#else
|
||||
return PyString_FromString(result.c_str());
|
||||
#endif
|
||||
}
|
||||
throw Py::Exception("This method accepts no argument");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user