mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
lib: fromstring() and tostring() are deprecated
fromstring() and tostring() are deprecated since Python 3.2 and have been removed in 3.9. Both functions were just aliases and this patch changes images.py to directly call fromybytes() and tobytes(). Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
committed by
Andrei Vagin
parent
c10aae8f6e
commit
abe3405b20
@@ -375,7 +375,7 @@ class ipc_sem_set_handler:
|
||||
s = array.array('H')
|
||||
if s.itemsize != sizeof_u16:
|
||||
raise Exception("Array size mismatch")
|
||||
s.fromstring(f.read(size))
|
||||
s.frombytes(f.read(size))
|
||||
f.seek(rounded - size, 1)
|
||||
return s.tolist()
|
||||
|
||||
@@ -389,7 +389,7 @@ class ipc_sem_set_handler:
|
||||
s.fromlist(extra)
|
||||
if len(s) != entry['nsems']:
|
||||
raise Exception("Number of semaphores mismatch")
|
||||
f.write(s.tostring())
|
||||
f.write(s.tobytes())
|
||||
f.write('\0' * (rounded - size))
|
||||
|
||||
def skip(self, f, pbuff):
|
||||
|
Reference in New Issue
Block a user