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>
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)