File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -631,10 +631,18 @@ def load(self, extension: str):
631631 try :
632632 import importlib .metadata
633633 except ImportError :
634- raise ImportError ("Cannot import importlib.metadata ! Upgrade Python." )
634+ log_loading .warning (
635+ "'%s' not loaded. "
636+ "Scapy extensions require at least Python 3.8+ !" % extension
637+ )
638+ return
635639
636640 # Get extension distribution
637- distr = importlib .metadata .distribution (extension )
641+ try :
642+ distr = importlib .metadata .distribution (extension )
643+ except importlib .metadata .PackageNotFoundError :
644+ log_loading .warning ("The extension '%s' was not found !" % extension )
645+ return
638646
639647 # Check the classifiers
640648 if distr .metadata .get ('License-Expression' , None ) not in self .GPLV2_LICENCES :
You can’t perform that action at this time.
0 commit comments