From: Joe Guo Date: Tue, 10 Apr 2018 00:45:34 +0000 (+1200) Subject: kcc/graph_utils: port string.translate for py3 X-Git-Tag: ldb-1.4.0~587 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=767f6e599af81f7b2be42981d997c3c02f7ac70c;p=thirdparty%2Fsamba.git kcc/graph_utils: port string.translate for py3 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 Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/kcc/graph_utils.py b/python/samba/kcc/graph_utils.py index c564bee7a0a..6e32100e004 100644 --- a/python/samba/kcc/graph_utils.py +++ b/python/samba/kcc/graph_utils.py @@ -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: