Patchwork D7017: lsprof: remove __main__ functionality

login
register
mail settings
Submitter phabricator
Date Oct. 8, 2019, 6:19 p.m.
Message ID <4541907d61aa6c11225211df52c356b7@localhost.localdomain>
Download mbox | patch
Permalink /patch/42113/
State Not Applicable
Headers show

Comments

phabricator - Oct. 8, 2019, 6:19 p.m.
Closed by commit rHGdc6d866b8cb8: lsprof: remove __main__ functionality (authored by indygreg).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7017?vs=16940&id=16968

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7017/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7017

AFFECTED FILES
  mercurial/lsprof.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/lsprof.py b/mercurial/lsprof.py
--- a/mercurial/lsprof.py
+++ b/mercurial/lsprof.py
@@ -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()