Skip to content

Commit 1b08108

Browse files
committed
print function
1 parent 8df6649 commit 1b08108

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

src/tests/leaktest.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import print_function
12
import System
23
import gc
34

@@ -15,7 +16,7 @@ def __init__(self):
1516

1617
def notify(self, msg):
1718
if not self.quiet:
18-
print msg
19+
print(msg)
1920

2021
def start_test(self):
2122
System.GC.Collect(System.GC.MaxGeneration)
@@ -32,8 +33,8 @@ def end_test(self):
3233
diff = '+%d' % diff
3334
else:
3435
diff = '%d' % diff
35-
print " start: %d end: %d diff: %s" % (start, end, diff)
36-
print ""
36+
print(" start: %d end: %d diff: %s" % (start, end, diff))
37+
print("")
3738

3839
def run(self):
3940
self.testModules()
@@ -48,7 +49,7 @@ def report(self):
4849
dicttype = type({})
4950
for item in gc.get_objects():
5051
if type(item) != dicttype:
51-
print item, sys.getrefcount(item)
52+
print(item, sys.getrefcount(item))
5253

5354
def testModules(self):
5455
self.notify("Running module leak check...")

src/tests/profile.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Run all of the unit tests for this package over and over,
22
in order to provide for better profiling."""
3+
from __future__ import print_function
34

45

56
def main():
@@ -14,15 +15,15 @@ def main():
1415
start = time.clock()
1516

1617
for i in range(50):
17-
print 'iteration: %d' % i
18+
print('iteration: %d' % i)
1819
runtests.main()
1920

2021
stop = time.clock()
2122
took = str(stop - start)
22-
print 'Total Time: %s' % took
23+
print('Total Time: %s' % took)
2324

2425
for item in gc.get_objects():
25-
print item, sys.getrefcount(item)
26+
print(item, sys.getrefcount(item))
2627

2728

2829
if __name__ == '__main__':

src/tests/stress.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
for memory leaks and threading issues and provides a good target for a
55
profiler to accumulate better data.
66
"""
7+
from __future__ import print_function
78

89
import sys, os, gc, time, threading, thread
910

@@ -19,7 +20,7 @@ def __init__(self):
1920

2021
def dprint(self, msg):
2122
# Debugging helper to trace thread-related tests.
22-
if 1: print msg
23+
if 1: print(msg)
2324

2425
def markStart(self):
2526
self._start = time.clock()
@@ -32,7 +33,7 @@ def elapsed(self):
3233

3334
def printGCReport(self):
3435
for item in gc.get_objects():
35-
print item, sys.getrefcount(item)
36+
print(item, sys.getrefcount(item))
3637

3738
def runThread(self, iterations):
3839
thread_id = thread.get_ident()

src/tests/stresstest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def main():
66
start = time.clock()
77

88
for i in range(2000):
9-
print i
9+
print(i)
1010
for name in (
1111
'test_module',
1212
'test_conversion',
@@ -32,7 +32,7 @@ def main():
3232

3333
import gc
3434
for i in gc.get_objects():
35-
print i
35+
print(i)
3636

3737

3838
if __name__ == '__main__':

0 commit comments

Comments
 (0)