[PATCH 0 of 6] Port of hg's C modules to py3k

Dan Villiom Podlaski Christiansen danchr at gmail.com
Tue Jun 8 14:24:37 CDT 2010


One general comment: You forgot to add commit messages to you patches. You might want to do that using e.g. ‘qrefresh --edit’ and resend it once others have had a chance to comment :)

On 8 Jun 2010, at 19:57, Renato Cunha wrote:

> Hi,
> 
> the following patches implement a preliminary port of mercurial's C modules to
> Python 3.
> 
> Main sources of incompatibility were:
> 
> 1. The PyString* functions, which are gone for good;
> 2. The PyInt_* functions, which are also gone for good;
> 3. The module initialization functions & conventions, which have changed.
> 
> To separate the python 2.x from the python 3.x implementations, I decided to
> check PY_MAJOR_VERSION and define a IS_PY3K "symbol" for later checking if the
> modules were being built by python 2.x or python 3.x, as suggested by the
> python documentation [1].
> 
> To substitute the PyString* calls I decided to go with PyBytes, as, I suppose,
> hg operates on bytes, anyway.

Did you consider the option of defining PyByte_* preprocessor macros as aliases for the PyString_* symbols? Python 2.6 contains a <bytesobject.h> header with such aliases.

--

Dan Villiom Podlaski Christiansen
danchr at gmail.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1943 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100608/de54c48a/attachment.bin>


More information about the Mercurial-devel mailing list