MCPcopy Create free account
hub / github.com/secdev/scapy / _version_checker

Function _version_checker

scapy/config.py:721–739  ·  view source on GitHub ↗

Checks that module has a higher version that minver. params: - module: a module to test - minver: a tuple of versions

(module, minver)

Source from the content-addressed store, hash-verified

719
720
721def _version_checker(module, minver):
722 # type: (ModuleType, Tuple[int, ...]) -> bool
723 """Checks that module has a higher version that minver.
724
725 params:
726 - module: a module to test
727 - minver: a tuple of versions
728 """
729 # We could use LooseVersion, but distutils imports imp which is deprecated
730 version_regexp = r'[a-z]?((?:\d|\.)+\d+)(?:\.dev[0-9]+)?'
731 version_tags_r = re.match(
732 version_regexp,
733 getattr(module, "__version__", "")
734 )
735 if not version_tags_r:
736 return False
737 version_tags_i = version_tags_r.group(1).split(".")
738 version_tags = tuple(int(x) for x in version_tags_i)
739 return bool(version_tags >= minver)
740
741
742def isCryptographyValid():

Callers 2

exploreFunction · 0.90
isCryptographyValidFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…