On Sep 28, 2009, at 2:43 AM, Ralph Heinkel wrote:

> Hi,
>
> I've setup a very simple testcase, where a main module imports  a
> package and calls a simple function from one module (using latest
> Cython-0.11.3 on python 2.6):
>
> main.py
>       import pack
>       pack.m1.doesomething()
> pack/__init__.py
>       import m1
> pack/m1.py
>       def dosomething()
>          print 'hello'
>
> $:~/tmp/cythontest> cython -r main.py
> Traceback (most recent call last):
>    File "/usr/local/bin/cython", line 8, in <module>
>      main(command_line = 1)
>    File
> "/usr/local/lib/python2.6/site-packages/Cython/Compiler/Main.py", line
> 740, in main
>      result = compile(sources, options)
>    File
> "/usr/local/lib/python2.6/site-packages/Cython/Compiler/Main.py", line
> 717, in compile
>      return compile_multiple(source, options)
>    File
> "/usr/local/lib/python2.6/site-packages/Cython/Compiler/Main.py", line
> 683, in compile_multiple
>      if not timestamps or context.c_file_out_of_date(source):
> NameError: global name 'context' is not defined
>
>
> Any idea what's wrong? What I would like to achieve is to compile all
> (possible) modules from a package into my main module.

There's a comment in the source

             # Compiling multiple sources in one context doesn't quite
             # work properly yet.

And I don't know that anyone's worked on (or used) this option. We  
should probably disable it until we get that ticket resolved. Until  
then, you need to compile each file individually.

http://trac.cython.org/cython_trac/ticket/379

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

Reply via email to