Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scapy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
c4a45a17
Commit
c4a45a17
authored
14 years ago
by
Phil
Browse files
Options
Downloads
Patches
Plain Diff
Catch exceptions from layers imports and print a warning message instead of crashing
parent
f3df7387
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/layers/all.py
+6
-1
6 additions, 1 deletion
scapy/layers/all.py
with
6 additions
and
1 deletion
scapy/layers/all.py
+
6
−
1
View file @
c4a45a17
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
from
scapy.config
import
conf
from
scapy.config
import
conf
from
scapy.error
import
log_loading
from
scapy.error
import
log_loading
import
logging
log
=
logging
.
getLogger
(
"
scapy.loading
"
)
def
_import_star
(
m
):
def
_import_star
(
m
):
mod
=
__import__
(
m
,
globals
(),
locals
())
mod
=
__import__
(
m
,
globals
(),
locals
())
...
@@ -13,7 +15,10 @@ def _import_star(m):
...
@@ -13,7 +15,10 @@ def _import_star(m):
for
_l
in
conf
.
load_layers
:
for
_l
in
conf
.
load_layers
:
log_loading
.
debug
(
"
Loading layer %s
"
%
_l
)
log_loading
.
debug
(
"
Loading layer %s
"
%
_l
)
_import_star
(
_l
)
try
:
_import_star
(
_l
)
except
Exception
,
e
:
log
.
warning
(
"
can
'
t import layer %s: %s
"
%
(
_l
,
e
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment