-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Hi,
Thanks for your work.
Now I'm writing to a script which reads a pcapng file from other sniffing machine
and add a comment on some specific packets and writes it in a seperate file in my machine.
In the middle of that, I met the below exception. I wonder why it's necessary to raise "duplicate interface_id...".
if type(blk) is blocks.InterfaceDescription:
# Have we already written this interface?
if blk.interface_id in self.interfaces:
# We have. Should this be an error?
raise PcapngDumpError(
"duplicate interface_id {}".format(blk.interface_id)
)
# No, so add it
self.interfaces.add(blk.interface_id)
Can we add "else" like this?
if type(blk) is blocks.InterfaceDescription:
# Have we already written this interface?
if blk.interface_id in self.interfaces:
# We have. Should this be an error?
raise PcapngDumpError(
"duplicate interface_id {}".format(blk.interface_id)
)
else:
# No, so add it
self.interfaces.add(blk.interface_id)
Metadata
Metadata
Assignees
Labels
No labels