Skip to content
Snippets Groups Projects
Commit c4a45a17 authored by Phil's avatar Phil
Browse files

Catch exceptions from layers imports and print a warning message instead of crashing

parent f3df7387
No related branches found
No related tags found
No related merge requests found
...@@ -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))
......
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