Re: TypeError: exceptions must be strings, classes, or instances, not type
Yang Zhang <[email protected]>
| Newsgroups | gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
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.