s4/scripting/bin: PY3 Fix exception tuple assignments.
authorNoel Power <noel.power@suse.com>
Fri, 28 Sep 2018 15:49:27 +0000 (16:49 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 23 Oct 2018 03:50:26 +0000 (05:50 +0200)
In Python3 to access the exception arguments you need to now use
Exception.args, in Python2 you could access these direcly with the
'except' declaration.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/scripting/bin/samba_spnupdate

index 8b84216fe6a3740c0f7746fdf94ac78655966c98..888b37f4c34c352d58a1207ac87de94f3bcef1c1 100755 (executable)
@@ -106,7 +106,8 @@ try:
         credentials = None
 
     samdb = SamDB(url=lp.samdb_url(), session_info=system_session(), credentials=credentials, lp=lp)
-except ldb.LdbError, (num, msg):
+except ldb.LdbError as e:
+    (num, msg) = e.args
     print("Unable to open sam database %s : %s" % (lp.samdb_url(), msg))
     sys.exit(1)