def _check_ipset_compatibility(self):
        try:
            ipset_version_string = subprocess.check_output([self.ipset_bin, "-v"])
        except subprocess.CalledProcessError:
            raise MissingBinaryError
        version_match = re.compile(r'protocol version:? (\d)')
        res = version_match.search(ipset_version_string)
        if res:
            version = int(res.groups()[0])
            if version == 6:
                self.legacy_ipset = False
        else:
            logger.error("Cannot find ipset version!")
            raise InvalidIPSetVersionError
Checks ipset binary compatibility.
dataset/ETHPy150Open facebookarchive/neti/neti/iptables.py/IPtables._check_ipset_compatibility