py3.7 fix

PyUnicode_AsUTF8() returns const char* in py3.7 instead of char*. Making
changes to reflect that which should also be safe in
other Python versions.
This commit is contained in:
Michal Ulianko
2018-08-17 14:42:21 +02:00
committed by wmayer
parent 591c1d32cd
commit faf8834484
12 changed files with 34 additions and 34 deletions

View File

@@ -190,7 +190,7 @@ TopoShapePyOld::~TopoShapePyOld() // Everything handled in parent
//--------------------------------------------------------------------------
// TopoShapePyOld Attributes
//--------------------------------------------------------------------------
PyObject *TopoShapePyOld::_getattr(char *attr) // __getattr__ function: note only need to handle new state
PyObject *TopoShapePyOld::_getattr(const char *attr) // __getattr__ function: note only need to handle new state
{
try{
// Access the number of attributes at this label
@@ -205,7 +205,7 @@ PyObject *TopoShapePyOld::_getattr(char *attr) // __getattr__ function: note
}
}
int TopoShapePyOld::_setattr(char *attr, PyObject *value) // __setattr__ function: note only need to handle new state
int TopoShapePyOld::_setattr(const char *attr, PyObject *value) // __setattr__ function: note only need to handle new state
{
if (Base::streq(attr, "Real")) // settable new state
;
@@ -712,4 +712,4 @@ PyObject *TopoShapePyOld::exportSTL(PyObject *args)
Py_Return;
}
#endif
#endif

View File

@@ -72,9 +72,9 @@ public:
//---------------------------------------------------------------------
virtual PyObject *_repr(void); // the representation
PyObject *_getattr(char *attr); // __getattr__ function
PyObject *_getattr(const char *attr); // __getattr__ function
// getter setter
int _setattr(char *attr, PyObject *value); // __setattr__ function
int _setattr(const char *attr, PyObject *value); // __setattr__ function
// methods
PYFUNCDEF_D (TopoShapePyOld,hasChild);