[Pyrex] TypeError: exceptions must be strings, classes, or instances, not type

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Apr 24 02:36:54 CEST 2008


Yang Zhang wrote:
> http://code.google.com/p/pypcap/
> 
> but I get:
> 
> Traceback (most recent call last):
>    File "./analyze.py", line 11, in <module>
>      for x in pc: xs.append(x)
>    File "pcap.pyx", line 346, in pcap.pcap.__next__
> TypeError: exceptions must be strings, classes, or instances, not type

What version of Pyrex are you using? A change was made in
0.9.6 to accommodate Python 2.5's use of new-style classes
as exceptions. This looks like something resulting from
using an earlier version.

If you check the top of the generated .c file, it will
tell you which version of Pyrex was used to generate it.

-- 
Greg



More information about the Pyrex mailing list