[PATCH 0 of 7] Port of hg's modules to py3k, round two

Renato Cunha renatoc at gmail.com
Thu Jun 10 13:39:49 UTC 2010


Hello,

this is the second iteration of my patches for adding support for py3k in
mercurial's C modules.

Based on previous feedback, I've defined a separate "util.h" file (the name
isn't set in stone, I just followed mpm's suggestion) that defines macros that
define the correct function names according to the current python version.

As you will notice, util.h is rather simple, but if the macro names are good
enough, it can be adjusted later. As always, suggestions are welcome.

Also notice that I decided for not defining macros for the module definition
functions because half of them won't use the standard boilerplate code and, for
consistency, I decided it was better to leave the #ifdef's in that part of the
code.

In osutil.c, the PyObject_HEAD_INIT call was substituted by a
PyVarObject_HEAD_INIT call, as this version works fine both in python 2.x and
python 3.x.

Regards.



More information about the Mercurial-devel mailing list