Bossgaming099 / ctypes-opencv

Automatically exported from code.google.com/p/ctypes-opencv
0 stars 0 forks source link

Python 3.0 compatibility #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
While 2to3 can be run to convert the package to a Python 3.0 compatible
source, there are actually minimal changes needed to avoid the need for
such a conversion.  It's mostly adjusting relative imports to absolute,
replacing xrange with range, and fixing some errors in exception generation.

So this patch (to trunk r102) supplies changes that produce a 3.0
compatible package.  To minimize performance/memory, it continues to use
xrange if available.

Original issue reported on code.google.com by db3l.em...@gmail.com on 26 Dec 2008 at 2:51

Attachments:

GoogleCodeExporter commented 8 years ago
Patched. Thanks.

Original comment by pmtri80@gmail.com on 26 Dec 2008 at 8:56

GoogleCodeExporter commented 8 years ago
I realized in separating my set of patches that my earlier cv namespace patch 
didn't
include some subsequent changes when I did the python 3.0 work.  The attached 
patch
removes the use of print as a warning during namespace creation (just punting 
and
putting the full symbol in) which keeps that code python 3.0 compatible.  

The patch is against trunk r113 and also includes one tweak to the final library
loading code to stay 3.0 compatible (since luckily the use of an exception 
variable
during the import was technically superfluous).

Original comment by db3l....@gmail.com on 26 Dec 2008 at 6:17

Attachments:

GoogleCodeExporter commented 8 years ago
Patched. Thanks.

Original comment by pmtri80@gmail.com on 27 Dec 2008 at 1:27