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 @@ -137,16 +137,16 @@ def parse_message(message):
137137 continue
138138 elif parts [i ][0 ] in ['i' ]:
139139 # General 8-bit unsigned decimal
140- b += int (parts [i ][1 :]).to_bytes (1 )
140+ b += int (parts [i ][1 :]).to_bytes (length = 1 , byteorder = 'big' , signed = False )
141141 elif parts [i ][0 ] in ['H' , 'k' , 'm' , 's' ]:
142142 # General 16-bit unsigned decimal
143143 # Or 'k' keepalive specific
144144 # Or 'm' mid specific
145145 # Or 's' string specific
146- b += int (parts [i ][1 :]).to_bytes (2 )
146+ b += int (parts [i ][1 :]).to_bytes (length = 2 , byteorder = 'big' , signed = False )
147147 elif parts [i ][0 ] == "L" :
148148 # 32-bit unsigned decimal
149- b += int (parts [i ][1 :]).to_bytes (4 )
149+ b += int (parts [i ][1 :]).to_bytes (length = 4 , byteorder = 'big' , signed = False )
150150 elif parts [i ][0 ] == "'" :
151151 s = parts [i ][1 :]
152152 while s [- 1 ] != "'" and i < len (parts )- 1 :
@@ -161,7 +161,7 @@ def parse_message(message):
161161 v = int (parts [i ][1 :])
162162 if v > 255 :
163163 raise ValueError ("Variable length > 255 needs implementing" )
164- b += v .to_bytes (1 )
164+ b += v .to_bytes (length = 1 , byteorder = 'big' , signed = False )
165165 else :
166166 # hex
167167 try :
You can’t perform that action at this time.
0 commit comments