Пример #1
0
 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)
Пример #2
0
 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)