mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 19:07:57 +00:00
Merge branch 'v0.7.0' into v0.8.0
This commit is contained in:
@@ -72,9 +72,16 @@
|
||||
|
||||
template <>
|
||||
std::string cast_pyobject(PyObject* element) {
|
||||
#if SWIG_VERSION >= 0x040200
|
||||
PyObject *pbytes = NULL;
|
||||
const char* str_data = SWIG_PyUnicode_AsUTF8AndSize(element, NULL, &pbytes);
|
||||
std::string str = str_data;
|
||||
Py_XDECREF(pbytes);
|
||||
#else
|
||||
char* str_data = SWIG_Python_str_AsChar(element);
|
||||
std::string str = str_data;
|
||||
SWIG_Python_str_DelForPy3(str_data);
|
||||
#endif
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user