Commit e74624d0 authored by Kirill Smelkov's avatar Kirill Smelkov

X -> py3 compatible print

parent 99c75057
...@@ -32,6 +32,8 @@ Version History: ...@@ -32,6 +32,8 @@ Version History:
""" """
from __future__ import print_function
LOOPS = 50000 LOOPS = 50000
from time import clock from time import clock
...@@ -59,9 +61,9 @@ FALSE = 0 ...@@ -59,9 +61,9 @@ FALSE = 0
def main(loops=LOOPS): def main(loops=LOOPS):
benchtime, stones = pystones(loops) benchtime, stones = pystones(loops)
print "Pystone(%s) time for %d passes = %g" % \ print("Pystone(%s) time for %d passes = %g" % \
(__version__, loops, benchtime) (__version__, loops, benchtime))
print "This machine benchmarks at %g pystones/second" % stones print("This machine benchmarks at %g pystones/second" % stones)
def pystones(loops=LOOPS): def pystones(loops=LOOPS):
...@@ -255,8 +257,8 @@ def Func3(EnumParIn): ...@@ -255,8 +257,8 @@ def Func3(EnumParIn):
if __name__ == '__main__': if __name__ == '__main__':
import sys import sys
def error(msg): def error(msg):
print >>sys.stderr, msg, print(msg, file=sys.stderr)
print >>sys.stderr, "usage: %s [number_of_loops]" % sys.argv[0] print("usage: %s [number_of_loops]" % sys.argv[0], file=sys.stderr)
sys.exit(100) sys.exit(100)
nargs = len(sys.argv) - 1 nargs = len(sys.argv) - 1
if nargs > 1: if nargs > 1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment