From 56c4a46656ed0b78d7aed33ed1bb1aeb7cea8101 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 30 Jun 2018 08:50:09 -0700 Subject: [PATCH] Fix some python2-only syntax --- bench/localpath.py | 6 ++---- doc/example/genhtml.py | 2 +- doc/example/genhtmlcss.py | 2 +- doc/example/genxml.py | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bench/localpath.py b/bench/localpath.py index ad4fbd8e..aad44f2e 100644 --- a/bench/localpath.py +++ b/bench/localpath.py @@ -1,6 +1,4 @@ - import py -import timeit class Listdir: numiter = 100000 @@ -70,6 +68,6 @@ def run(self): for i in xrange(cls.numiter): inst.run() elapsed = time.time() - now - print "%s: %d loops took %.2f seconds, per call %.6f" %( + print("%s: %d loops took %.2f seconds, per call %.6f" %( cls.__name__, - cls.numiter, elapsed, elapsed / cls.numiter) + cls.numiter, elapsed, elapsed / cls.numiter)) diff --git a/doc/example/genhtml.py b/doc/example/genhtml.py index b5c8f525..7a6d4934 100644 --- a/doc/example/genhtml.py +++ b/doc/example/genhtml.py @@ -8,6 +8,6 @@ html.body( [html.p(p) for p in paras])) -print unicode(doc).encode('latin1') +print(unicode(doc).encode('latin1')) diff --git a/doc/example/genhtmlcss.py b/doc/example/genhtmlcss.py index 3e6d0af5..facca77b 100644 --- a/doc/example/genhtmlcss.py +++ b/doc/example/genhtmlcss.py @@ -20,4 +20,4 @@ class p(html.p): ) ) -print doc.unicode(indent=2) +print(doc.unicode(indent=2)) diff --git a/doc/example/genxml.py b/doc/example/genxml.py index 5f754e88..444a4ca5 100644 --- a/doc/example/genxml.py +++ b/doc/example/genxml.py @@ -12,6 +12,6 @@ class ns(py.xml.Namespace): ns.title("Java for Python programmers"),), publisher="N.N", ) -print doc.unicode(indent=2).encode('utf8') +print(doc.unicode(indent=2).encode('utf8'))