samba_tool: Py2/Py3 compatability fix tuple assigment
authorNoel Power <noel.power@suse.com>
Fri, 4 May 2018 10:28:46 +0000 (11:28 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 12 May 2018 19:38:16 +0000 (21:38 +0200)
replace
    (foo, bar) = e
with
    (foo, bar) = e.args

while will run in with both python2 and python3

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/__init__.py

index 77976780150b26655678fb67cc28209563846490..9df096d5bd3e15b72f4c9c7eabdf2e7a6a5820c8 100644 (file)
@@ -103,7 +103,7 @@ class Command(object):
             force_traceback = True
 
         if isinstance(inner_exception, LdbError):
-            (ldb_ecode, ldb_emsg) = inner_exception
+            (ldb_ecode, ldb_emsg) = inner_exception.args
             self.errf.write("ERROR(ldb): %s - %s\n" % (message, ldb_emsg))
         elif isinstance(inner_exception, AssertionError):
             self.errf.write("ERROR(assert): %s\n" % message)