Skip to content

Commit

Permalink
Merge pull request #191 from asottile/py2_py3_syntax
Browse files Browse the repository at this point in the history
Fix some python2-only syntax
  • Loading branch information
RonnyPfannschmidt authored Jun 30, 2018
2 parents 255c2a5 + 56c4a46 commit b7ff2e9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions bench/localpath.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

import py
import timeit

class Listdir:
numiter = 100000
Expand Down Expand Up @@ -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))
2 changes: 1 addition & 1 deletion doc/example/genhtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
html.body(
[html.p(p) for p in paras]))

print unicode(doc).encode('latin1')
print(unicode(doc).encode('latin1'))


2 changes: 1 addition & 1 deletion doc/example/genhtmlcss.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ class p(html.p):
)
)

print doc.unicode(indent=2)
print(doc.unicode(indent=2))
2 changes: 1 addition & 1 deletion doc/example/genxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))


0 comments on commit b7ff2e9

Please sign in to comment.