From 79638073089a99034d0e6c7544582a7a010e8082 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 27 Jan 2022 09:27:42 +1300 Subject: [PATCH] [python] Remove unused bogus fallback macro This fallback version of PyString_AS_STRING() for Python 3 makes use of PyUnicode_AS_STRING, but I can find no evidence that ever existed in Python - all references I've found are to SWIG or SWIG-generated code. The only uses of PyString_AS_STRING() in SWIG generated code are for Python 2 #if-branches, so this fallback is never used by SWIG. Because it doesn't work it can't be usefully used in user interface files either, so let's remove it to avoid potential user confusion (such as #987). --- Lib/python/pyhead.swg | 1 - 1 file changed, 1 deletion(-) diff --git a/Lib/python/pyhead.swg b/Lib/python/pyhead.swg index 4ae8bbe2e..669990719 100644 --- a/Lib/python/pyhead.swg +++ b/Lib/python/pyhead.swg @@ -13,7 +13,6 @@ #define PyString_Size(str) PyBytes_Size(str) #define PyString_InternFromString(key) PyUnicode_InternFromString(key) #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE -#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x) #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) #endif