From 4954b3692d550d0bbc92e482060a023fd14b4e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Mon, 15 Jan 2018 21:56:22 +0100 Subject: [PATCH] python: fix the build with python3. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13221 Guenther Signed-off-by: Guenther Deschner --- python/samba/emulate/traffic_packets.py | 2 +- python/samba/forest_update.py | 4 ++-- python/samba/tests/blackbox/traffic_summary.py | 2 +- python/samba/tests/samba_tool/visualize.py | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/samba/emulate/traffic_packets.py b/python/samba/emulate/traffic_packets.py index 1df21f99a35..185d1d57476 100644 --- a/python/samba/emulate/traffic_packets.py +++ b/python/samba/emulate/traffic_packets.py @@ -84,7 +84,7 @@ name_formats = [ def warning(message): - print "\033[37;41;1m" "Warning: %s" "\033[00m" % (message) + print("\033[37;41;1m" "Warning: %s" "\033[00m" % (message)) ############################################################################### # diff --git a/python/samba/forest_update.py b/python/samba/forest_update.py index 9f6ddf6aac2..ba6f859a943 100644 --- a/python/samba/forest_update.py +++ b/python/samba/forest_update.py @@ -300,8 +300,8 @@ objectClass: container "SCHEMA_DN": str(self.schema_dn)}) if self.verbose: - print "UPDATE (LDIF) ------ OPERATION %d" % op - print sub_ldif + print("UPDATE (LDIF) ------ OPERATION %d" % op) + print(sub_ldif) self.samdb.modify_ldif(sub_ldif) if self.add_update_container: diff --git a/python/samba/tests/blackbox/traffic_summary.py b/python/samba/tests/blackbox/traffic_summary.py index b2bbc2cb075..99fe6b84e94 100644 --- a/python/samba/tests/blackbox/traffic_summary.py +++ b/python/samba/tests/blackbox/traffic_summary.py @@ -59,7 +59,7 @@ class TrafficSummaryTests(BlackboxTestCase): with temp_file(self.tempdir) as output: command = "%s %s >%s" % (SCRIPT, INPUT, output) - print command + print(command) self.check_run(command) expected = open(EXPECTED_FN).readlines() actual = open(output).readlines() diff --git a/python/samba/tests/samba_tool/visualize.py b/python/samba/tests/samba_tool/visualize.py index 292d4961f45..c00c6ea63b0 100644 --- a/python/samba/tests/samba_tool/visualize.py +++ b/python/samba/tests/samba_tool/visualize.py @@ -284,7 +284,7 @@ class SambaToolVisualizeLdif(SambaToolCmdTest): self.tempdir, self.lp, tag='disconnected') dburl = 'tdb://' + dbfile - print dbfile + print(dbfile) result, output, err = self.runsubcmd("visualize", "ntdsconn", '-H', dburl, '--color=no', '-S') @@ -314,7 +314,7 @@ class SambaToolVisualizeLdif(SambaToolCmdTest): '-o', '-') self.assertCmdSuccess(result, dot, err) self.remove_files(dbfile) - print dot + print(dot) self.assertStringsEqual(EXPECTED_DOT_NTDSCONN_DISCONNECTED, dot, strip=True) @@ -338,7 +338,7 @@ class SambaToolVisualizeLdif(SambaToolCmdTest): self.assertStringsEqual(EXPECTED_DOT_NTDSCONN_DISCONNECTED, dot) self.remove_files(dbfile, dot_file) - print dot + print(dot) EXPECTED_DOT_MULTISITE_NO_KEY = r"""/* generated by samba */ digraph A_samba_tool_production { -- 2.14.3