Skip to content

Commit 0a36696

Browse files
Fix mistake in AsyncSniffer stop_cb (#4781)
Co-authored-by: gpotter2 <[email protected]>
1 parent 0f7b0c0 commit 0a36696

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scapy/sendrecv.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,9 +1400,8 @@ def stop(self, join=True):
14001400
# type: (bool) -> Optional[PacketList]
14011401
"""Stops AsyncSniffer if not in async mode"""
14021402
if self.running:
1403-
try:
1404-
self.stop_cb()
1405-
except AttributeError:
1403+
self.stop_cb()
1404+
if self.continue_sniff:
14061405
raise Scapy_Exception(
14071406
"Unsupported (offline or unsupported socket)"
14081407
)

0 commit comments

Comments
 (0)