From cb89cabb9d6a18ef495838d75ccec0a6b458fe5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 28 May 2015 15:26:35 +0200 Subject: [PATCH] Use bytes and bytearray restore database Since changeset dca8bcce5c30, it is bytes or bytearray that is used instead of buffer. issue4761 review11241002 --- tryton/gui/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tryton/gui/main.py b/tryton/gui/main.py index 03178e2b76..7d30662918 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -1314,8 +1314,9 @@ class Main(object): with open(filename, 'rb') as file_p: data = file_p.read() host, port = url.rsplit(':', 1) + cast = bytearray if bytes == str else bytes rpcprogress = common.RPCProgress('db_exec', (host, int(port), - 'restore', dbname, passwd, buffer(data), update)) + 'restore', dbname, passwd, cast(data), update)) try: res = rpcprogress.run(False) except TrytonServerError, exception: