[Baypiggies] Python 3 and swig help for m2crypto?

Marv marvkausch at gmail.com
Wed Nov 18 01:41:09 EST 2015


Hello All:
   After numerous attempts, I still have not become unsubscribed. Would someone please unsubscribe me? Thank you.




> On Nov 17, 2015, at 9:12 PM, Craig Rodrigues <rodrigc at FreeBSD.org> wrote:
> 
> Hi,
> 
> I did the following:
> (1)  Read "PEP 0328 -- Imports: Multi-Line and Absolute/Relative"  ( https://www.python.org/dev/peps/pep-0328/ ) a few times.
> 
> (2)  Ran "2to3 -f import M2Crypto" to generate a list of places to which needed fixing of the imports
> 
> (3)  Applied the patch from (2), and also added "from __future__ import absolute_import" to all the files
>        that I touched.  This brings in the PEP 328 behavior which is default in Python 3, back to Python 2.
> 
> (4)  I tested out this patch: https://gitlab.com/rodrigc/m2crypto/commit/4e5937ac
>        Under Python 2.7, the tests passed.
> 
> However, I tested the code under Python 3, and got the attached error.
> It turns out that the Python C API has changed between Python 2 and Python 3.
> So, Python code which uses the C API (such as M2Crypto) needs to be ported. (!!)
>      https://docs.python.org/3/howto/cporting.html
> 
> --
> Craig
> 
>> On Mon, Nov 16, 2015 at 4:57 PM, Fahrzin Hemmati <fahhem at google.com> wrote:
>> 
>> I'm not sure, but maybe converting that to a relative import “import ._m2crypto” or “from . import _m2crypto” might fix it, but only for python 3. Maybe running a specific incantation of 2to3 against the file in the build step?
> <error.txt>
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> https://mail.python.org/mailman/listinfo/baypiggies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20151117/a63f4607/attachment.html>


More information about the Baypiggies mailing list