github / glb-director

GitHub Load Balancer Director and supporting tooling.
Other
2.37k stars 227 forks source link

Fix float division result errors in Python 3 #133

Open jstangroome opened 2 years ago

jstangroome commented 2 years ago

https://docs.python.org/3/howto/pyporting.html#division

Error without this change in Python 3 is:

/usr/lib/python3.9/site-packages/scapy/fields.py in addfield(self, pkt, s, ival)
   2167             v = 0
   2168         v <<= self.size
-> 2169         v |= val & ((1 << self.size) - 1)
   2170         bitsdone += self.size
   2171         while bitsdone >= 8:

TypeError: unsupported operand type(s) for &: 'float' and 'int'