##// END OF EJS Templates
py3: bulk-replace bytes format specifier passed to Py_BuildValue()...
Yuya Nishihara -
r36637:1f8c3fad default
parent child Browse files
Show More
@@ -718,7 +718,8 b' static lazymanifest *lazymanifest_filter'
718 718 Py_INCREF(self->pydata);
719 719 for (i = 0; i < self->numlines; i++) {
720 720 PyObject *arglist = NULL, *result = NULL;
721 arglist = Py_BuildValue("(s)", self->lines[i].start);
721 arglist = Py_BuildValue(PY23("(s)", "(y)"),
722 self->lines[i].start);
722 723 if (!arglist) {
723 724 return NULL;
724 725 }
@@ -184,7 +184,7 b' static PyObject *make_item(const WIN32_F'
184 184 ? _S_IFDIR : _S_IFREG;
185 185
186 186 if (!wantstat)
187 return Py_BuildValue("si", fd->cFileName, kind);
187 return Py_BuildValue(PY23("si", "yi"), fd->cFileName, kind);
188 188
189 189 py_st = PyObject_CallObject((PyObject *)&listdir_stat_type, NULL);
190 190 if (!py_st)
@@ -202,7 +202,7 b' static PyObject *make_item(const WIN32_F'
202 202 if (kind == _S_IFREG)
203 203 stp->st_size = ((__int64)fd->nFileSizeHigh << 32)
204 204 + fd->nFileSizeLow;
205 return Py_BuildValue("siN", fd->cFileName,
205 return Py_BuildValue(PY23("siN", "yiN"), fd->cFileName,
206 206 kind, py_st);
207 207 }
208 208
@@ -390,9 +390,11 b' static PyObject *_listdir_stat(char *pat'
390 390 stat = makestat(&st);
391 391 if (!stat)
392 392 goto error;
393 elem = Py_BuildValue("siN", ent->d_name, kind, stat);
393 elem = Py_BuildValue(PY23("siN", "yiN"), ent->d_name,
394 kind, stat);
394 395 } else
395 elem = Py_BuildValue("si", ent->d_name, kind);
396 elem = Py_BuildValue(PY23("si", "yi"), ent->d_name,
397 kind);
396 398 if (!elem)
397 399 goto error;
398 400 stat = NULL;
@@ -570,9 +572,11 b' static PyObject *_listdir_batch(char *pa'
570 572 stat = makestat(&st);
571 573 if (!stat)
572 574 goto error;
573 elem = Py_BuildValue("siN", filename, kind, stat);
575 elem = Py_BuildValue(PY23("siN", "yiN"),
576 filename, kind, stat);
574 577 } else
575 elem = Py_BuildValue("si", filename, kind);
578 elem = Py_BuildValue(PY23("si", "yi"),
579 filename, kind);
576 580 if (!elem)
577 581 goto error;
578 582 stat = NULL;
@@ -1108,7 +1112,7 b' static PyObject *getfstype(PyObject *sel'
1108 1112 r = statfs(path, &buf);
1109 1113 if (r != 0)
1110 1114 return PyErr_SetFromErrno(PyExc_OSError);
1111 return Py_BuildValue("s", describefstype(&buf));
1115 return Py_BuildValue(PY23("s", "y"), describefstype(&buf));
1112 1116 }
1113 1117 #endif /* defined(HAVE_LINUX_STATFS) || defined(HAVE_BSD_STATFS) */
1114 1118
@@ -1126,7 +1130,7 b' static PyObject *getfsmountpoint(PyObjec'
1126 1130 r = statfs(path, &buf);
1127 1131 if (r != 0)
1128 1132 return PyErr_SetFromErrno(PyExc_OSError);
1129 return Py_BuildValue("s", buf.f_mntonname);
1133 return Py_BuildValue(PY23("s", "y"), buf.f_mntonname);
1130 1134 }
1131 1135 #endif /* defined(HAVE_BSD_STATFS) */
1132 1136
@@ -254,7 +254,7 b' static PyObject *parse_dirstate(PyObject'
254 254 goto quit;
255 255 }
256 256
257 parents = Py_BuildValue("s#s#", str, 20, str + 20, 20);
257 parents = Py_BuildValue(PY23("s#s#", "y#y#"), str, 20, str + 20, 20);
258 258 if (!parents)
259 259 goto quit;
260 260
@@ -87,9 +87,9 b' static const char nullid[20];'
87 87 static Py_ssize_t inline_scan(indexObject *self, const char **offsets);
88 88
89 89 #if LONG_MAX == 0x7fffffffL
90 static char *tuple_format = "Kiiiiiis#";
90 static char *tuple_format = PY23("Kiiiiiis#", "Kiiiiiiy#");
91 91 #else
92 static char *tuple_format = "kiiiiiis#";
92 static char *tuple_format = PY23("kiiiiiis#", "kiiiiiiy#");
93 93 #endif
94 94
95 95 /* A RevlogNG v1 index entry is 64 bytes long. */
@@ -2077,7 +2077,7 b' void revlog_module_init(PyObject *mod)'
2077 2077 Py_INCREF(&indexType);
2078 2078 PyModule_AddObject(mod, "index", (PyObject *)&indexType);
2079 2079
2080 nullentry = Py_BuildValue("iiiiiiis#", 0, 0, 0,
2080 nullentry = Py_BuildValue(PY23("iiiiiiis#", "iiiiiiiy#"), 0, 0, 0,
2081 2081 -1, -1, -1, -1, nullid, 20);
2082 2082 if (nullentry)
2083 2083 PyObject_GC_UnTrack(nullentry);
General Comments 0
You need to be logged in to leave comments. Login now