changeset 30104:63e1dca2d6a4

dirs: inline string macros The old code happened to work because of how the macro was defined. This no longer works in Python 3. Furthermore, assigning to a macro just feels weird. So just inline the macro.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 08 Oct 2016 16:02:51 +0200
parents 74cd33c9be76
children b2f90d8878ac
files mercurial/dirs.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirs.c	Sat Oct 08 22:44:02 2016 +0200
+++ b/mercurial/dirs.c	Sat Oct 08 16:02:51 2016 +0200
@@ -61,8 +61,8 @@
 			if (key == NULL)
 				goto bail;
 		}
-		PyString_GET_SIZE(key) = pos;
-		PyString_AS_STRING(key)[pos] = '\0';
+		Py_SIZE(key) = pos;
+		((PyStringObject *)key)->ob_sval[pos] = '\0';
 
 		val = PyDict_GetItem(dirs, key);
 		if (val != NULL) {