[Botan-devel] configure.py with Python 3

Jack Lloyd lloyd at randombit.net
Fri Jul 9 09:58:08 EDT 2010


On Fri, Jul 09, 2010 at 08:10:32AM +0100, botan at pjohnson.allmail.net wrote:
w
> If it's a lot of hassle, I'll install Python 2.6, but for all I know it
> may only require minor tweaks by someone who knows what they're doing,
> so I thought I'd ask.

The easiest solution is to use the `2to3` script, which is included in
Python 2.6 and Python 3.1. It will make a bunch of changes which
aren't actually necessary, but it will work. By default it will just
print a diff of the changes it suggests, but you can use the -w flag
to have it modify in place:

$ 2to3 -w configure.py

In 1.9, the only changes necessary for 3.1 compatability are changing
the exception catches to 'Exception as e' style. Python 2.6 also
supports this syntax, but unfortunately Python 2.4 does not and I
think retaining compatability there is useful as it's still widely
deployed. Eventually though the same script will be able to support
2.6+ and 3.1+ out of the box, once 2.4/2.5 compatability is no longer
a concern.

> P.S. Incidentally, I don't know if it's changed in the latest
> development release, but my copy of building.pdf is still saying to use
> configure.pl, which then recommends you use configure.py - not really a
> problem, but I thought I'd point it out.

1.8.9's build instructions now suggest the Python version. I should
have changed this long before that, though.

-Jack



More information about the botan-devel mailing list