Patchwork [2,of,7] osutil: convert PyString* to PyBytes*

login
register
mail settings
Submitter Gregory Szorc
Date Oct. 8, 2016, 8:48 p.m.
Message ID <921f070e83bcf78ffcca.1475959688@gps-mbp.local>
Download mbox | patch
Permalink /patch/16961/
State Accepted
Headers show

Comments

Gregory Szorc - Oct. 8, 2016, 8:48 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1475956735 -7200
#      Sat Oct 08 21:58:55 2016 +0200
# Node ID 921f070e83bcf78ffccac50c75ad6f8eebf2894b
# Parent  d9914b172e706be9b208e84977160cdc3b3d5266
osutil: convert PyString* to PyBytes*

Continuing the conversion from PyString* to PyBytes*.

Patch

diff --git a/mercurial/osutil.c b/mercurial/osutil.c
--- a/mercurial/osutil.c
+++ b/mercurial/osutil.c
@@ -623,9 +623,9 @@  static PyObject *statfiles(PyObject *sel
 
 		pypath = PySequence_GetItem(names, i);
 		if (!pypath)
 			goto bail;
-		path = PyString_AsString(pypath);
+		path = PyBytes_AsString(pypath);
 		if (path == NULL) {
 			Py_DECREF(pypath);
 			PyErr_SetString(PyExc_TypeError, "not a string");
 			goto bail;