Patchwork [1,of,6] dirs: use PyVarObject_HEAD_INIT

login
register
mail settings
Submitter Gregory Szorc
Date Oct. 13, 2016, 7:44 p.m.
Message ID <1f30bcebd4bdc26602ec.1476387853@gps-mbp.local>
Download mbox | patch
Permalink /patch/17059/
State Accepted
Headers show

Comments

Gregory Szorc - Oct. 13, 2016, 7:44 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1476357254 -7200
#      Thu Oct 13 13:14:14 2016 +0200
# Node ID 1f30bcebd4bdc26602ec4e9ae924f101c7642594
# Parent  c0410814002f467c24ef07ce73850ba15b306f8e
dirs: use PyVarObject_HEAD_INIT

This makes a compiler warning go away on Python 3.
Yuya Nishihara - Oct. 15, 2016, 7:50 a.m.
On Thu, 13 Oct 2016 21:44:13 +0200, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1476357254 -7200
> #      Thu Oct 13 13:14:14 2016 +0200
> # Node ID 1f30bcebd4bdc26602ec4e9ae924f101c7642594
> # Parent  c0410814002f467c24ef07ce73850ba15b306f8e
> dirs: use PyVarObject_HEAD_INIT

These look good. Queued, thanks.

Patch

diff --git a/mercurial/dirs.c b/mercurial/dirs.c
--- a/mercurial/dirs.c
+++ b/mercurial/dirs.c
@@ -288,9 +288,9 @@  static PyMethodDef dirs_methods[] = {
 	{"delpath", (PyCFunction)dirs_delpath, METH_VARARGS, "remove a path"},
 	{NULL} /* Sentinel */
 };
 
-static PyTypeObject dirsType = { PyObject_HEAD_INIT(NULL) };
+static PyTypeObject dirsType = { PyVarObject_HEAD_INIT(NULL, 0) };
 
 void dirs_module_init(PyObject *mod)
 {
 	dirs_sequence_methods.sq_contains = (objobjproc)dirs_contains;