Skip to content

Commit e6bf6ad

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

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

CHANGES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Notable changes in recent builds.
1+
Notable changes in recent builds.
22

33
Maintained by hand, so what's "notable" is subjective! Contributors are
44
encouraged to add entries for their work.
@@ -17,7 +17,7 @@ Coming in build 311, as yet unreleased
1717
* Fixed `TypeError: cannot unpack non-iterable NoneType object` when registering an axscript client ScriptItem (#2513, @Avasam)
1818
* Fixed a memory leak when SafeArrays are used as out parameters (@the-snork)
1919
* Fixed dispatch handling for properties (@the-snork)
20-
* Resolved a handful of deprecation warnings (#2567, #2576, @Avasam)
20+
* Resolved a handful of deprecation warnings (#2567, #2576, #2591, @Avasam)
2121
* The following classes now produce a valid `eval` string representation when calling `repr`: (#2573, @Avasam)
2222
* `pywin.tools.browser.HLIPythonObject`
2323
* `win32com.server.exception.COMException`

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)