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

Yang Zhang yanghatespam at gmail.com
Thu Apr 24 06:23:59 CEST 2008


Greg Ewing wrote:
> 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.
> 

You're right, somehow I ended up using 0.9.3 instead of 0.9.6.4.  Thanks.



More information about the Pyrex mailing list