comparison mercurial/lsprof.py @ 27617:b1a59b80e1a3

lsprof: use print function
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 02 Jan 2016 11:40:53 -0800
parents 9c75daf89450
children d4e5b2653693
comparison
equal deleted inserted replaced
27616:0765d8423fbc 27617:b1a59b80e1a3
1 from __future__ import absolute_import 1 from __future__ import absolute_import, print_function
2 2
3 import _lsprof 3 import _lsprof
4 import sys 4 import sys
5 5
6 Profiler = _lsprof.Profiler 6 Profiler = _lsprof.Profiler
111 111
112 if __name__ == '__main__': 112 if __name__ == '__main__':
113 import os 113 import os
114 sys.argv = sys.argv[1:] 114 sys.argv = sys.argv[1:]
115 if not sys.argv: 115 if not sys.argv:
116 print >> sys.stderr, "usage: lsprof.py <script> <arguments...>" 116 print("usage: lsprof.py <script> <arguments...>", file=sys.stderr)
117 sys.exit(2) 117 sys.exit(2)
118 sys.path.insert(0, os.path.abspath(os.path.dirname(sys.argv[0]))) 118 sys.path.insert(0, os.path.abspath(os.path.dirname(sys.argv[0])))
119 stats = profile(execfile, sys.argv[0], globals(), locals()) 119 stats = profile(execfile, sys.argv[0], globals(), locals())
120 stats.sort() 120 stats.sort()
121 stats.pprint() 121 stats.pprint()