def any2i(self, pkt, x): if type(x) is str: try: a, b, c = map(int, x.split("/")) x = (a << 11) | (b << 8) | c except: raise ValueError(x) return ShortField.any2i(self, pkt, x)
def any2i(self, pkt, x): if isinstance(x, str): try: a, b, c = map(int, x.split("/")) x = (a << 11) | (b << 8) | c except ValueError: raise ValueError(x) return ShortField.any2i(self, pkt, x)