Skip to content
Snippets Groups Projects
Commit 2a605807 authored by Pierre Lalet's avatar Pierre Lalet Committed by GitHub
Browse files

Merge pull request #417 from p-l-/Romounet-srfix

Fixed a bug in the sendrecv method when using multi-threading
parents 3579d736 f18a8f5c
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,8 @@ Functions to send and receive packets.
import errno
import cPickle,os,sys,time,subprocess
import itertools
from select import select
from select import select, error as select_error
from scapy.arch.consts import DARWIN, FREEBSD, OPENBSD
from scapy.data import *
from scapy.config import conf
......@@ -140,8 +141,9 @@ def sndrcv(pks, pkt, timeout = None, inter = 0, verbose=None, chainCC=0, retry=0
inp = []
try:
inp, out, err = select(inmask,[],[], remaintime)
except IOError, exc:
if exc.errno != errno.EINTR:
except (IOError, select_error) as exc:
# select.error has no .errno attribute
if exc.args[0] != errno.EINTR:
raise
if len(inp) == 0:
break
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment