fix _db_command: TypeError: a bytes-like object is required, not 'list'

Bytes come in as an array of integers, which we could probably solve on
the PyO3 end instead, but this will do for now - the same fix is already
used for non-DB case.

https://forums.ankiweb.net/t/anki-2-1-50-beta/15608/15
This commit is contained in:
Damien Elmes 2021-12-05 08:00:26 +10:00
parent 43c41d76ba
commit 9af87ba082

View File

@ -97,7 +97,7 @@ class RustBackend(RustBackendGenerated):
try:
return from_json_bytes(self._backend.db_command(bytes_input))
except Exception as error:
err_bytes = error.args[0]
err_bytes = bytes(error.args[0])
err = backend_pb2.BackendError()
err.ParseFromString(err_bytes)
raise backend_exception_to_pylib(err)