File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1616from .tokenizer import Name
1717
1818
19+ # Use Self type if possible
1920match version_info [:2 ]:
2021 case 3 , 10 :
2122 Self = 'TIEntry'
@@ -447,7 +448,7 @@ def __format__(self, format_spec: str) -> str:
447448 case sep , width :
448449 string = self .calc_data .hex (sep , int (width ))
449450
450- return string if match ["case" ] == "x" else string .upper ()
451+ return string . lower () if match ["case" ] == "x" else string .upper ()
451452
452453 elif not format_spec :
453454 return super ().__str__ ()
@@ -636,6 +637,10 @@ def next_entry_length(stream: BinaryIO) -> int:
636637 data_length = int .from_bytes (stream .read (2 ), 'little' )
637638 stream .seek (- 4 , 1 )
638639
640+ if meta_length not in (TIEntry .base_meta_length , TIEntry .flash_meta_length ):
641+ warn (f"Got unexpected meta length ({ meta_length } ) from bytestream." ,
642+ BytesWarning )
643+
639644 return 2 + meta_length + 2 + data_length
640645
641646 @classmethod
You can’t perform that action at this time.
0 commit comments