From: Joe Guo Date: Wed, 28 Mar 2018 02:08:40 +0000 (+1300) Subject: samba3: work around bytes formatting for Python 3.4 X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=fe9e62935c459e4cdab0cefea1412614dd1969a8 samba3: work around bytes formatting for Python 3.4 b'%s\x00' % key The above % formatting for bytes is only available since Python 3.5, however we need to support Python 3.4 so far. Work around this with `+`. Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/samba3/__init__.py b/python/samba/samba3/__init__.py index a0bb76f68c1c..f7927836c989 100644 --- a/python/samba/samba3/__init__.py +++ b/python/samba/samba3/__init__.py @@ -87,7 +87,7 @@ class Registry(DbDatabase): :param key: Key path. :return: list with key names """ - data = self.db.get(b"%s\x00" % key) + data = self.db.get(key + b"\x00") if data is None: return [] (num, ) = struct.unpack("