CXX, Objects.hxx: Python 3.9 Unicode compilation warning fixes suggested by wmayer on the FC forum.
This commit is contained in:
@@ -2135,13 +2135,20 @@ namespace Py
|
||||
// Queries
|
||||
virtual size_type size() const
|
||||
{
|
||||
return PyUnicode_GET_SIZE( ptr() );
|
||||
return PyUnicode_GetLength( ptr() );
|
||||
}
|
||||
|
||||
#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 9
|
||||
const Py_UNICODE *unicode_data() const
|
||||
{
|
||||
return PyUnicode_AS_UNICODE( ptr() );
|
||||
}
|
||||
|
||||
unicodestring as_unicodestring() const
|
||||
{
|
||||
return unicodestring( PyUnicode_AS_UNICODE( ptr() ), PyUnicode_GET_SIZE( ptr() ) );
|
||||
return unicodestring( unicode_data(), PyUnicode_GetLength( ptr() ) );
|
||||
}
|
||||
#endif
|
||||
|
||||
operator std::string() const
|
||||
{
|
||||
@@ -2154,11 +2161,6 @@ namespace Py
|
||||
Bytes b( encode( encoding, error ) );
|
||||
return b.as_std_string();
|
||||
}
|
||||
|
||||
const Py_UNICODE *unicode_data() const
|
||||
{
|
||||
return PyUnicode_AS_UNICODE( ptr() );
|
||||
}
|
||||
};
|
||||
|
||||
// ==================================================
|
||||
|
||||
Reference in New Issue
Block a user