clarify error messages

The old error messages displayed valid values as unicode strings, but the displayed actual value was in bytes. The new error messages display the valid values as bytes now to avoid confusion.
master
Josiah 2021-07-24 23:12:35 -05:00
parent 32ddaaf109
commit 8eb543155c
No known key found for this signature in database
GPG Key ID: C7BB8573A4ABC4B9
1 changed files with 2 additions and 2 deletions

View File

@ -167,7 +167,7 @@ class Blendfile(io.FileIO):
else: else:
raise BlendDecodeError( raise BlendDecodeError(
f"Invalid pointer size character {header.pointer_size}; " \ f"Invalid pointer size character {header.pointer_size}; " \
"must be '-' or '_'!") f"must be {b'-'} or {b'_'}!")
if header.endianness == bytes("v", "utf-8"): if header.endianness == bytes("v", "utf-8"):
self.endianness = "little" self.endianness = "little"
elif header.endianess == bytes("V", "utf-8"): elif header.endianess == bytes("V", "utf-8"):
@ -175,7 +175,7 @@ class Blendfile(io.FileIO):
else: else:
raise BlendDecodeError( raise BlendDecodeError(
f"Invalid endianness character {header.endianess}; "\ f"Invalid endianness character {header.endianess}; "\
"must be 'v' or 'V'") f"must be {b'v'} or {b'V'}")
if not header.version.isdigit(): if not header.version.isdigit():
raise BlendDecodeError( raise BlendDecodeError(
f"Invalid version string {header.version}!") f"Invalid version string {header.version}!")