Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:help': 0.08; 'string': 0.09; 'exception.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'happened?': 0.16; 'subclass': 0.16; 'typeerror:': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'skip:f 30': 0.19; 'written': 0.21; 'aug': 0.22; 'python?': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'this:': 0.26; 'defined': 0.27; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'file': 0.32; 'class': 0.32; 'run': 0.32; 'something': 0.35; 'anybody': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'raising': 0.36; 'hi,': 0.36; 'pm,': 0.38; 'skip:p 20': 0.39; 'how': 0.40; 'solve': 0.60; '26,': 0.68; 'subject:! ': 0.74; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=ckJ54z/dpDqChY/VYYfcbAe2YqymXR0LjbYps7ItJFw=; b=uV+oAf30+v52uTDIkKh+ssLzDh/hh/e08uCDza4+3KIsiJbFUZENjIZjlmSgQjzbXE M/2LQgIAiXTcqigDZGSTwJnFKc5/FvRAFxfL8PotUEix5yeek4kcDZ+gou1SFx8/Wod1 fy36ew8Y4do07ph9yNWPUtoD1a520VMWd4dk6ndhP4Zzy2VXCTe0A/Nc3rEuvxYfzE7m bnOGX4jFZ5gAV/IPq2vedIKW7huWLryNCh69/c6Ng8/cM2hrC9/cKLCizT2HaVRCcfER oYlwQD9dVIvaA3o5Dgw01n9fnl+Fph3PJUU1zyyy3qZHRhMvYRXTBAZTgrtR6EeCTSNN 3viQ== MIME-Version: 1.0 X-Received: by 10.43.96.65 with SMTP id cf1mr29801815icc.26.1409064315871; Tue, 26 Aug 2014 07:45:15 -0700 (PDT) In-Reply-To: <89a67381-4e4f-4ae0-83e3-59ca48bdf619@googlegroups.com> References: <89a67381-4e4f-4ae0-83e3-59ca48bdf619@googlegroups.com> Date: Wed, 27 Aug 2014 00:45:15 +1000 Subject: Re: help! about pypcap.dispatch From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409064325 news.xs4all.nl 2879 [2001:888:2000:d::a6]:32893 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77045 On Tue, Aug 26, 2014 at 8:44 PM, wrote: > Hi, > > I'm using Python 2.7.6 in Centos 6.5. > > I have defined > "p = pcap.pcap(timeout_ms=1000) > def function(timestamp,pkt,*args): > " > and try to run "p.dispatch(-1,function)" > > and I got this: > p.dispatch(-1,function) > File "pcap.pyx", line 296, in pcap.pcap.dispatch (pcap.c:3182) > TypeError: raise: exception class must be a subclass of BaseException > > why this happened? Anybody know how to solve it? Where did pcap.pyx come from? What version is it? Is it something that was written for an ancient version of Python? It might be raising a string exception. ChrisA