File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -343,15 +343,15 @@ def read_int64(self) -> int:
343
343
def unpack_uint16 (self , n : bytes ) -> int :
344
344
return struct .unpack ('<H' , n [0 :2 ])[0 ]
345
345
346
- def unpack_int24 (self , n : bytes ) -> Optional [str , Tuple [str , int ]]:
346
+ def unpack_int24 (self , n : bytes ) -> Optional [Union [ int , Tuple [str , int ] ]]:
347
347
try :
348
348
return struct .unpack ('B' , n [0 ])[0 ] \
349
349
+ (struct .unpack ('B' , n [1 ])[0 ] << 8 ) \
350
350
+ (struct .unpack ('B' , n [2 ])[0 ] << 16 )
351
351
except TypeError :
352
352
return n [0 ] + (n [1 ] << 8 ) + (n [2 ] << 16 )
353
353
354
- def unpack_int32 (self , n : bytes ) -> Optional [str , Tuple [str , int ]]:
354
+ def unpack_int32 (self , n : bytes ) -> Optional [Union [ int , Tuple [str , int ] ]]:
355
355
try :
356
356
return struct .unpack ('B' , n [0 ])[0 ] \
357
357
+ (struct .unpack ('B' , n [1 ])[0 ] << 8 ) \
You can’t perform that action at this time.
0 commit comments