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 16
16
from .tokenizer import Name
17
17
18
18
19
+ # Use Self type if possible
19
20
match version_info [:2 ]:
20
21
case 3 , 10 :
21
22
Self = 'TIEntry'
@@ -447,7 +448,7 @@ def __format__(self, format_spec: str) -> str:
447
448
case sep , width :
448
449
string = self .calc_data .hex (sep , int (width ))
449
450
450
- return string if match ["case" ] == "x" else string .upper ()
451
+ return string . lower () if match ["case" ] == "x" else string .upper ()
451
452
452
453
elif not format_spec :
453
454
return super ().__str__ ()
@@ -636,6 +637,10 @@ def next_entry_length(stream: BinaryIO) -> int:
636
637
data_length = int .from_bytes (stream .read (2 ), 'little' )
637
638
stream .seek (- 4 , 1 )
638
639
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
+
639
644
return 2 + meta_length + 2 + data_length
640
645
641
646
@classmethod
You can’t perform that action at this time.
0 commit comments