Skip to content
Snippets Groups Projects
Commit 29a048a3 authored by Guillaume Valadon's avatar Guillaume Valadon
Browse files

Merged in p-l/scapy/issue-5126 (pull request #118)

Close pcap files in .__exit__() (fixes #5126)
parents 44b58a91 e62d456c
No related branches found
No related tags found
No related merge requests found
...@@ -618,7 +618,7 @@ class RawPcapReader: ...@@ -618,7 +618,7 @@ class RawPcapReader:
return self return self
def __exit__(self, exc_type, exc_value, tracback): def __exit__(self, exc_type, exc_value, tracback):
pass self.close()
class PcapReader(RawPcapReader): class PcapReader(RawPcapReader):
...@@ -750,6 +750,7 @@ class RawPcapWriter: ...@@ -750,6 +750,7 @@ class RawPcapWriter:
return self return self
def __exit__(self, exc_type, exc_value, tracback): def __exit__(self, exc_type, exc_value, tracback):
self.flush() self.flush()
self.close()
class PcapWriter(RawPcapWriter): class PcapWriter(RawPcapWriter):
......
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