File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -186,11 +186,11 @@ def get_netmask_bits(self):
186186 # count bits in "packed":
187187 result = 0
188188 for ch in packed :
189- ch = ord (ch )
189+ ch = ord (ch ) if isinstance ( ch , str ) else ch
190190 while ch :
191191 if ch & 1 :
192192 result += 1
193- ch /= 2
193+ ch // = 2
194194 return result
195195
196196 def __repr__ (self ):
@@ -916,8 +916,8 @@ def test_parsing_device_line(self):
916916 self .assertEqual (dev .txcompressed , 11 )
917917
918918 def test_parse_ip4addr (self ):
919- self .assertEqual (parse_ip4addr ('1.1.1.1' ), '\x01 \x01 \x01 \x01 ' )
920- self .assertEqual (parse_ip4addr ('127.0.0.1' ), '\x7f \x00 \x00 \x01 ' )
919+ self .assertEqual (parse_ip4addr ('1.1.1.1' ), b '\x01 \x01 \x01 \x01 ' )
920+ self .assertEqual (parse_ip4addr ('127.0.0.1' ), b '\x7f \x00 \x00 \x01 ' )
921921
922922 def test_local (self ):
923923 # Actually invoke ifconfig locally, and parse whatever it emits:
You can’t perform that action at this time.
0 commit comments