]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
kcc/graph_utils: port string.translate for py3
authorJoe Guo <joeg@catalyst.net.nz>
Tue, 10 Apr 2018 00:45:34 +0000 (12:45 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 13 Apr 2018 05:27:13 +0000 (07:27 +0200)
In py3, `str.translate` removed the second positional argument
`deletechars`, which means you can not use it to delete chars from str.
Use `replace` for this case.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/kcc/graph_utils.py

index c564bee7a0a3311f78197306a540004e724b1633..6e32100e004d9f05564ae2442ee92f3d62b35b0f 100644 (file)
@@ -32,7 +32,7 @@ def write_dot_file(basename, edge_list, vertices=None, label=None,
     s = dot_graph(vertices, edge_list, title=label, **kwargs)
     if label:
         # sanitise DN and guid labels
-        basename += '_' + label.translate(None, ', ')
+        basename += '_' + label.replace(', ', '')
 
     filename = os.path.join(dot_file_dir, "%s.dot" % basename)
     if debug is not None: