Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 22, 2023. It is now read-only.
/pythonnetPublic archive
forked frompythonnet/pythonnet

Commit1b08108

Browse files
committed
print function
1 parent8df6649 commit1b08108

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

‎src/tests/leaktest.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__importprint_function
12
importSystem
23
importgc
34

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

1617
defnotify(self,msg):
1718
ifnotself.quiet:
18-
printmsg
19+
print(msg)
1920

2021
defstart_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
defrun(self):
3940
self.testModules()
@@ -48,7 +49,7 @@ def report(self):
4849
dicttype=type({})
4950
foritemingc.get_objects():
5051
iftype(item)!=dicttype:
51-
printitem,sys.getrefcount(item)
52+
print(item,sys.getrefcount(item))
5253

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

‎src/tests/profile.py

Lines changed: 4 additions & 3 deletions
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__importprint_function
34

45

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

1617
foriinrange(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
foritemingc.get_objects():
25-
printitem,sys.getrefcount(item)
26+
print(item,sys.getrefcount(item))
2627

2728

2829
if__name__=='__main__':

‎src/tests/stress.py

Lines changed: 3 additions & 2 deletions
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__importprint_function
78

89
importsys,os,gc,time,threading,thread
910

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

2021
defdprint(self,msg):
2122
# Debugging helper to trace thread-related tests.
22-
if1:printmsg
23+
if1:print(msg)
2324

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

3334
defprintGCReport(self):
3435
foritemingc.get_objects():
35-
printitem,sys.getrefcount(item)
36+
print(item,sys.getrefcount(item))
3637

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

‎src/tests/stresstest.py

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

88
foriinrange(2000):
9-
printi
9+
print(i)
1010
fornamein (
1111
'test_module',
1212
'test_conversion',
@@ -32,7 +32,7 @@ def main():
3232

3333
importgc
3434
foriingc.get_objects():
35-
printi
35+
print(i)
3636

3737

3838
if__name__=='__main__':

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp