diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2018-02-14 10:18:36 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-02-15 00:18:30 +0100 |
commit | 4885937bf87e6c37c60cda890dc18d46b5868a91 (patch) | |
tree | 0802ebd0f6086dbf2a81d3882a34181858264493 /python/samba/dbchecker.py | |
parent | a485ac32438b74315ffd4a7188909f00e175d4fa (diff) | |
download | samba-4885937bf87e6c37c60cda890dc18d46b5868a91.tar.gz |
samba python libs: convert 'except X, e' to 'except X as e'
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python/samba/dbchecker.py')
-rw-r--r-- | python/samba/dbchecker.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py index b2b8b0c9558..5e06d1f3b40 100644 --- a/python/samba/dbchecker.py +++ b/python/samba/dbchecker.py @@ -369,7 +369,7 @@ systemFlags: -1946157056%s""" % (dn, guid_suffix), try: controls = controls + ["local_oid:%s:0" % dsdb.DSDB_CONTROL_DBCHECK] self.samdb.delete(dn, controls=controls) - except Exception, err: + except Exception as err: if self.in_transaction: raise CommandError("%s : %s" % (msg, err)) self.report("%s : %s" % (msg, err)) @@ -383,7 +383,7 @@ systemFlags: -1946157056%s""" % (dn, guid_suffix), try: controls = controls + ["local_oid:%s:0" % dsdb.DSDB_CONTROL_DBCHECK] self.samdb.modify(m, controls=controls, validate=validate) - except Exception, err: + except Exception as err: if self.in_transaction: raise CommandError("%s : %s" % (msg, err)) self.report("%s : %s" % (msg, err)) @@ -402,7 +402,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) to_dn = to_rdn + to_base controls = controls + ["local_oid:%s:0" % dsdb.DSDB_CONTROL_DBCHECK] self.samdb.rename(from_dn, to_dn, controls=controls) - except Exception, err: + except Exception as err: if self.in_transaction: raise CommandError("%s : %s" % (msg, err)) self.report("%s : %s" % (msg, err)) @@ -1565,7 +1565,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) cls = None try: cls = obj["objectClass"][-1] - except KeyError, e: + except KeyError as e: pass if cls is None: @@ -2191,7 +2191,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) # special handling for some specific attribute types try: syntax_oid = self.samdb_schema.get_syntax_oid_from_lDAPDisplayName(attrname) - except Exception, msg: + except Exception as msg: self.err_unknown_attribute(obj, attrname) error_count += 1 continue |