Mercurial > hg
comparison mercurial/dirs.c @ 30167:1e5ff5ae1d2b
dirs: use PyVarObject_HEAD_INIT
This makes a compiler warning go away on Python 3.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 13 Oct 2016 13:14:14 +0200 |
parents | fb5504d7b2c9 |
children |
comparison
equal
deleted
inserted
replaced
30166:102e6ef5bb3a | 30167:1e5ff5ae1d2b |
---|---|
289 {"addpath", (PyCFunction)dirs_addpath, METH_VARARGS, "add a path"}, | 289 {"addpath", (PyCFunction)dirs_addpath, METH_VARARGS, "add a path"}, |
290 {"delpath", (PyCFunction)dirs_delpath, METH_VARARGS, "remove a path"}, | 290 {"delpath", (PyCFunction)dirs_delpath, METH_VARARGS, "remove a path"}, |
291 {NULL} /* Sentinel */ | 291 {NULL} /* Sentinel */ |
292 }; | 292 }; |
293 | 293 |
294 static PyTypeObject dirsType = { PyObject_HEAD_INIT(NULL) }; | 294 static PyTypeObject dirsType = { PyVarObject_HEAD_INIT(NULL, 0) }; |
295 | 295 |
296 void dirs_module_init(PyObject *mod) | 296 void dirs_module_init(PyObject *mod) |
297 { | 297 { |
298 dirs_sequence_methods.sq_contains = (objobjproc)dirs_contains; | 298 dirs_sequence_methods.sq_contains = (objobjproc)dirs_contains; |
299 dirsType.tp_name = "parsers.dirs"; | 299 dirsType.tp_name = "parsers.dirs"; |