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 f721dd9a17
commit 2e2b8cba6a
12 changed files with 34 additions and 34 deletions

View File

@@ -224,8 +224,8 @@ public:
/// setter for special attributes (e.g. dynamic ones)
/// Output: Success=1, Failure=-1, Ignore=0
int setCustomAttributes(const char* attr, PyObject *obj);
PyObject *_getattr(char *attr); // __getattr__ function
int _setattr(char *attr, PyObject *value); // __setattr__ function
PyObject *_getattr(const char *attr); // __getattr__ function
int _setattr(const char *attr, PyObject *value); // __setattr__ function
-
/// getter for the object handled by this class
@@ -727,7 +727,7 @@ PyObject *@self.export.Name@::_repr(void)
//--------------------------------------------------------------------------
// @self.export.Name@ Attributes
//--------------------------------------------------------------------------
PyObject *@self.export.Name@::_getattr(char *attr) // __getattr__ function: note only need to handle new state
PyObject *@self.export.Name@::_getattr(const char *attr) // __getattr__ function: note only need to handle new state
{
try {
// getter method for special Attributes (e.g. dynamic ones)
@@ -795,7 +795,7 @@ PyObject *@self.export.Name@::_getattr(char *attr) // __getattr__ function: n
return @self.export.Father@::_getattr(attr);
}
int @self.export.Name@::_setattr(char *attr, PyObject *value) // __setattr__ function: note only need to handle new state
int @self.export.Name@::_setattr(const char *attr, PyObject *value) // __setattr__ function: note only need to handle new state
{
try {
// setter for special Attributes (e.g. dynamic ones)