changeset 43108:dc6d866b8cb8

lsprof: remove __main__ functionality I'm pretty sure nobody uses this. I noticed it because Python 3 linting is complaining about execfile. Differential Revision: https://phab.mercurial-scm.org/D7017
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 07 Oct 2019 10:28:32 -0400
parents 5e9188f054d9
children f244da1fc4c6
files mercurial/lsprof.py
diffstat 1 files changed, 0 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/lsprof.py	Mon Oct 07 10:26:46 2019 -0400
+++ b/mercurial/lsprof.py	Mon Oct 07 10:28:32 2019 -0400
@@ -143,16 +143,3 @@
         res = res.encode('latin-1')
 
     return res
-
-
-if __name__ == '__main__':
-    import os
-
-    sys.argv = sys.argv[1:]
-    if not sys.argv:
-        print(b"usage: lsprof.py <script> <arguments...>", file=sys.stderr)
-        sys.exit(2)
-    sys.path.insert(0, os.path.abspath(os.path.dirname(sys.argv[0])))
-    stats = profile(execfile, sys.argv[0], globals(), locals())
-    stats.sort()
-    stats.pprint()