Re: TypeError: exceptions must be strings, classes, or instances, not type

Greg Ewing <[email protected]>
Newsgroups gmane.comp.python.pyrex
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.