diff options
-rw-r--r-- | external/python3/UnpackedTarball_python3.mk | 1 | ||||
-rw-r--r-- | external/python3/py_deprecated_warning.patch.0 | 20 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_util.cxx | 8 |
3 files changed, 4 insertions, 25 deletions
diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk index 5822940e9924..4b1ae232a3cb 100644 --- a/external/python3/UnpackedTarball_python3.mk +++ b/external/python3/UnpackedTarball_python3.mk @@ -28,7 +28,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\ external/python3/python-3.7.6-msvc-ssl.patch.1 \ external/python3/python-3.5.4-msvc-disable.patch.1 \ external/python3/ubsan.patch.0 \ - external/python3/py_deprecated_warning.patch.0 \ external/python3/python-3.5.tweak.strip.soabi.patch \ external/python3/darwin.patch.0 \ external/python3/macos-11.patch.0 \ diff --git a/external/python3/py_deprecated_warning.patch.0 b/external/python3/py_deprecated_warning.patch.0 deleted file mode 100644 index 2deefa6e531f..000000000000 --- a/external/python3/py_deprecated_warning.patch.0 +++ /dev/null @@ -1,20 +0,0 @@ ---- Include/cpython/unicodeobject.h 2024-06-10 10:53:20.049824821 +0200 -+++ Include/cpython/unicodeobject.h 2024-06-10 10:54:50.776970835 +0200 -@@ -548,7 +548,7 @@ - only allowed if u was set to NULL. - - The buffer is copied into the new object. */ --Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( -+/*Py_DEPRECATED(3.3)*/ PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( - const Py_UNICODE *u, /* Unicode buffer */ - Py_ssize_t size /* size of buffer */ - ); -@@ -577,7 +577,7 @@ - Py_UNICODE buffer. - If the wchar_t/Py_UNICODE representation is not yet available, this - function will calculate it. */ --Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( -+/*Py_DEPRECATED(3.3)*/ PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( - PyObject *unicode /* Unicode object */ - ); - diff --git a/pyuno/source/module/pyuno_util.cxx b/pyuno/source/module/pyuno_util.cxx index f01d33acfb86..355ff2f8b828 100644 --- a/pyuno/source/module/pyuno_util.cxx +++ b/pyuno/source/module/pyuno_util.cxx @@ -36,10 +36,10 @@ PyRef ustring2PyUnicode( const OUString & str ) PyRef ret; #if Py_UNICODE_SIZE == 2 #ifdef MACOSX - ret = PyRef( PyUnicode_FromUnicode( reinterpret_cast<const unsigned short *>(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE ); + ret = PyRef( PyUnicode_FromWideChar( reinterpret_cast<const unsigned short *>(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE ); #else static_assert(sizeof (wchar_t) == Py_UNICODE_SIZE, "bad assumption"); - ret = PyRef( PyUnicode_FromUnicode( reinterpret_cast<wchar_t const *>(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE ); + ret = PyRef( PyUnicode_FromWideChar( reinterpret_cast<wchar_t const *>(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE ); #endif #else OString sUtf8(OUStringToOString(str, RTL_TEXTENCODING_UTF8)); @@ -59,11 +59,11 @@ OUString pyString2ustring( PyObject *pystr ) OUString ret; if( PyUnicode_Check( pystr ) ) { + Py_ssize_t size(0); #if Py_UNICODE_SIZE == 2 ret = OUString( - reinterpret_cast<sal_Unicode const *>(PyUnicode_AS_UNICODE( pystr )) ); + reinterpret_cast<sal_Unicode const *>(PyUnicode_AsWideCharString( pystr, &size )) ); #else - Py_ssize_t size(0); char const *pUtf8(PyUnicode_AsUTF8AndSize(pystr, &size)); ret = OUString(pUtf8, size, RTL_TEXTENCODING_UTF8); #endif |