Skip to content

Commit

Permalink
Allow generator to be used for sr function issue #31
Browse files Browse the repository at this point in the history
  • Loading branch information
phaethon committed Nov 12, 2015
1 parent 0cc599c commit ee66c1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scapy/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
################

import re,random,socket
from types import GeneratorType
import scapy.config
from . import error

Expand All @@ -22,7 +23,7 @@ def __iter__(self):
class SetGen(Gen):
def __init__(self, col, _iterpacket=1):
self._iterpacket=_iterpacket
if type(col) is list:
if type(col) is list or isinstance(col, GeneratorType):
self.col = col
elif isinstance(col, BasePacketList):
self.col = list(col)
Expand Down

0 comments on commit ee66c1d

Please sign in to comment.