diff --git a/py/cmdline/pywhich.py b/py/cmdline/pywhich.py index 644ba8436..b1b940437 100755 --- a/py/cmdline/pywhich.py +++ b/py/cmdline/pywhich.py @@ -18,6 +18,6 @@ def main(): try: location = mod.__file__ except AttributeError: - sys.stderr.write("module (has no __file__): " + mod) + sys.stderr.write("module (has no __file__): " + str(mod)) else: print(location) diff --git a/py/thread/testing/test_io.py b/py/thread/testing/test_io.py index 0ed9feb9a..52d6c3d59 100644 --- a/py/thread/testing/test_io.py +++ b/py/thread/testing/test_io.py @@ -34,7 +34,7 @@ class TestThreadOut: defaults = [] def f(l): out.setwritefunc(l.append) - print(id(l)) + sys.stdout.write(str(id(l))) out.delwritefunc() print(1) out.setdefaultwriter(defaults.append) @@ -46,7 +46,7 @@ class TestThreadOut: pool.dispatch(f, l) pool.shutdown() for name, value in out.__dict__.items(): - sys.stderr.write("%s: %s\n" %(name, value)) + sys.stderr.write("%s: %s" %(name, value)) pool.join(2.0) for i in range(num): item = listlist[i] diff --git a/py/xmlobj/html.py b/py/xmlobj/html.py index a1a1ec66a..32a26d470 100644 --- a/py/xmlobj/html.py +++ b/py/xmlobj/html.py @@ -2,6 +2,7 @@ """ +import sys from py.xml import Namespace, Tag from py.__.xmlobj.visit import SimpleUnicodeVisitor