Skip to content

Add ScapyNotRunningException - #5258

Open
hedrok wants to merge 1 commit into
secdev:masterfrom
hedrok:add-scapy-not-running-exception
Open

hedrok wants to merge 1 commit into
secdev:masterfrom
hedrok:add-scapy-not-running-exception

Conversation

@hedrok

@hedrok hedrok commented Oct 28, 2026

Copy link
Copy Markdown

Description

Add ScapyNotRunningException

Currently when stopping AsyncSniffer there is no easy way to tell whether the sniffer just was already stopped or some other error occured. Add separate ScapyNotRunningException for that.

I have to use

        try:
            sniffer.stop()
        except Scapy_Exception as e:
            if e.args[0] != "Not running ! (check .running attr)":
                raise

Very not nice and fragile...

Maybe I've missed some better way?

I've put AI-Assisted: no as I used Claude Opus 5.5 only as reviewer and I expect that it is needed to discern generated code, not review etc. It would be helpful if more details are given in CONTRIBUTING.md, please write if I'm mistaken.

Currently when stopping AsyncSniffer there is no easy way to tell
whether the sniffer just was already stopped or some other error
occured. Add separate ScapyNotRunningException for that.

AI-Assisted: no
@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.55%. Comparing base (c388704) to head (a91736d).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
scapy/sendrecv.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5258   +/-   ##
=======================================
  Coverage   80.54%   80.55%           
=======================================
  Files         375      375           
  Lines       98399    98401    +2     
=======================================
+ Hits        79259    79265    +6     
+ Misses      19140    19136    -4     
Files with missing lines Coverage Δ
scapy/error.py 97.10% <100.00%> (+0.08%) ⬆️
scapy/sendrecv.py 87.03% <50.00%> (-0.14%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant