Skip to content

Commit c18be83

Browse files
committed
Replace _PyUnicode_AsString with PyUnicode_AsUTF8
1 parent d764900 commit c18be83

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

win32/src/PyWinTypes.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,8 @@
5252
// Macro to handle PyObject layout changes in Py3k
5353
#define PYWIN_OBJECT_HEAD PyVarObject_HEAD_INIT(NULL, 0)
5454

55-
/* Attribute names are passed as Unicode in Py3k, so use a macro to
56-
switch between string and unicode conversion. This function is not
57-
documented, but is used extensively in the Python codebase itself,
58-
so it's reasonable to assume it won't disappear anytime soon.
59-
*/
60-
#define PYWIN_ATTR_CONVERT (char *)_PyUnicode_AsString
55+
// This macro is kept for legacy reason as it's casting from `const char *` to `char *`
56+
#define PYWIN_ATTR_CONVERT (char *)PyUnicode_AsUTF8
6157

6258
typedef Py_ssize_t Py_hash_t;
6359

0 commit comments

Comments
 (0)