On Oct 3, 2009, at 8:39 PM, Mark Lodato wrote:

> It appears that changeset c951607190c2 broke --embed and  
> cython_freeze.
>
> http://hg.cython.org/cython-devel/rev/c951607190c2
>
> You can see this problem in Demos/freeze.  Just run make and then run
> ./nCr.  Or, you can boil it down to this simple example:
>
> $ echo "print __name__" > simple.pyx
>
> $ cython --embed simple.pyx
>
> $ gcc -I/usr/include/python2.6 simple.c -o simple -Xlinker
> -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
> /usr/lib/python2.6/config/libpython2.6.a -lm -ldl -pthread -lutil -lz
>
> $ ./simple
> Traceback (most recent call last):
>   File "simple.pyx", line 1, in init simple (simple.c:454)
>     print __name__
> NameError: __name__
>
>
> I think the problem is that __Pyx_InitGlobals() is now being called
> after __Pyx_SetAttrString(__pyx_m, "__name__", __pyx_kp___main__), but
> I don't know enough about Cython or the Python API to know how to fix
> this.

Yep, that is the problem. Fix at http://hg.cython.org/cython-devel/ 
rev/55e5ddc03e3b Still needs a regression test.

> On an unrelated note, cython_freeze.py should be executable, and
> perhaps installed with "python setup.py install".


Yes, that makes sense.

  - Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to