t5uid1: fix Python3 errors

This commit is contained in:
Desuuuu 2022-08-28 18:29:29 +02:00
parent d1a778ee1d
commit 23e13e94a1
No known key found for this signature in database
GPG Key ID: 85943F4B2C2CE0DC
1 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ class T5UID1_Var:
raise config.error("Invalid address '%s' in section '%s'"
% (address, config.get_name()))
data_types = TYPES_LEN.keys()
data_types = list(TYPES_LEN.keys())
data_types.append('str')
if self.type == "input":
data_types.append('none')
@ -122,7 +122,7 @@ class T5UID1_Var:
result = self._template.render(context)
if self.data_type == "str":
result = bytearray(result.replace('\n', ''))
result = bytearray(result.replace('\n', ''), "ascii")
target_len = self.data_len
if target_len % 2 != 0:
target_len += 1