| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,4 @@ | |||
| 1 | + from __future__ import print_function | ||
| 1 | 2 | import System | |
| 2 | 3 | import gc | |
| 3 | 4 | ||
@@ -15,7 +16,7 @@ def __init__(self): | |||
| 15 | 16 | ||
| 16 | 17 | def notify(self, msg): | |
| 17 | 18 | if not self.quiet: | |
| 18 | - print msg | ||
| 19 | + print(msg) | ||
| 19 | 20 | ||
| 20 | 21 | def start_test(self): | |
| 21 | 22 | System.GC.Collect(System.GC.MaxGeneration) | |
@@ -32,8 +33,8 @@ def end_test(self): | |||
| 32 | 33 | diff = '+%d' % diff | |
| 33 | 34 | else: | |
| 34 | 35 | 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("") | ||
| 37 | 38 | ||
| 38 | 39 | def run(self): | |
| 39 | 40 | self.testModules() | |
@@ -48,7 +49,7 @@ def report(self): | |||
| 48 | 49 | dicttype = type({}) | |
| 49 | 50 | for item in gc.get_objects(): | |
| 50 | 51 | if type(item) != dicttype: | |
| 51 | - print item, sys.getrefcount(item) | ||
| 52 | + print(item, sys.getrefcount(item)) | ||
| 52 | 53 | ||
| 53 | 54 | def testModules(self): | |
| 54 | 55 | self.notify("Running module leak check...") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,6 @@ | |||
| 1 | 1 | """Run all of the unit tests for this package over and over, | |
| 2 | 2 | in order to provide for better profiling.""" | |
| 3 | + from __future__ import print_function | ||
| 3 | 4 | ||
| 4 | 5 | ||
| 5 | 6 | def main(): | |
@@ -14,15 +15,15 @@ def main(): | |||
| 14 | 15 | start = time.clock() | |
| 15 | 16 | ||
| 16 | 17 | for i in range(50): | |
| 17 | - print 'iteration: %d' % i | ||
| 18 | + print('iteration: %d' % i) | ||
| 18 | 19 | runtests.main() | |
| 19 | 20 | ||
| 20 | 21 | stop = time.clock() | |
| 21 | 22 | took = str(stop - start) | |
| 22 | - print 'Total Time: %s' % took | ||
| 23 | + print('Total Time: %s' % took) | ||
| 23 | 24 | ||
| 24 | 25 | for item in gc.get_objects(): | |
| 25 | - print item, sys.getrefcount(item) | ||
| 26 | + print(item, sys.getrefcount(item)) | ||
| 26 | 27 | ||
| 27 | 28 | ||
| 28 | 29 | if __name__ == '__main__': | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,6 +4,7 @@ | |||
| 4 | 4 | for memory leaks and threading issues and provides a good target for a | |
| 5 | 5 | profiler to accumulate better data. | |
| 6 | 6 | """ | |
| 7 | + from __future__ import print_function | ||
| 7 | 8 | ||
| 8 | 9 | import sys, os, gc, time, threading, thread | |
| 9 | 10 | ||
@@ -19,7 +20,7 @@ def __init__(self): | |||
| 19 | 20 | ||
| 20 | 21 | def dprint(self, msg): | |
| 21 | 22 | # Debugging helper to trace thread-related tests. | |
| 22 | - if 1: print msg | ||
| 23 | + if 1: print(msg) | ||
| 23 | 24 | ||
| 24 | 25 | def markStart(self): | |
| 25 | 26 | self._start = time.clock() | |
@@ -32,7 +33,7 @@ def elapsed(self): | |||
| 32 | 33 | ||
| 33 | 34 | def printGCReport(self): | |
| 34 | 35 | for item in gc.get_objects(): | |
| 35 | - print item, sys.getrefcount(item) | ||
| 36 | + print(item, sys.getrefcount(item)) | ||
| 36 | 37 | ||
| 37 | 38 | def runThread(self, iterations): | |
| 38 | 39 | thread_id = thread.get_ident() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,7 @@ def main(): | |||
| 6 | 6 | start = time.clock() | |
| 7 | 7 | ||
| 8 | 8 | for i in range(2000): | |
| 9 | - print i | ||
| 9 | + print(i) | ||
| 10 | 10 | for name in ( | |
| 11 | 11 | 'test_module', | |
| 12 | 12 | 'test_conversion', | |
@@ -32,7 +32,7 @@ def main(): | |||
| 32 | 32 | ||
| 33 | 33 | import gc | |
| 34 | 34 | for i in gc.get_objects(): | |
| 35 | - print i | ||
| 35 | + print(i) | ||
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | 38 | if __name__ == '__main__': | |
| Back | FazBrowse Home | New Git URL |
0 commit comments