@@ -10,23 +10,6 @@ import pstats
10
10
import sys
11
11
import time
12
12
13
- # Try to detect where it is run from and set prefix and the search path.
14
- # It is assumed that the user installed StGIT using the --prefix= option
15
- prefix , bin = os .path .split (sys .path [0 ])
16
-
17
- if bin == 'bin' and prefix != sys .prefix :
18
- sys .prefix = prefix
19
- sys .exec_prefix = prefix
20
-
21
- major , minor = sys .version_info [0 :2 ]
22
- local_path = [os .path .join (prefix , 'lib' , 'python' ),
23
- os .path .join (prefix , 'lib' , 'python%s.%s' % (major , minor )),
24
- os .path .join (prefix , 'lib' , 'python%s.%s' % (major , minor ),
25
- 'site-packages' )]
26
- sys .path = local_path + sys .path
27
-
28
- from stgit .main import main
29
-
30
13
__copyright__ = """
31
14
Copyright (C) 2005, Catalin Marinas <[email protected] >
32
15
@@ -44,7 +27,26 @@ along with this program; if not, see http://www.gnu.org/licenses/.
44
27
"""
45
28
46
29
if __name__ == '__main__' :
30
+ # Try to detect where it is run from and set prefix and the search path.
31
+ # It is assumed that the user installed StGIT using the --prefix= option
32
+ prefix , bin = os .path .split (sys .path [0 ])
33
+
34
+ if bin == 'bin' and prefix != sys .prefix :
35
+ sys .prefix = prefix
36
+ sys .exec_prefix = prefix
37
+
38
+ major , minor = sys .version_info [0 :2 ]
39
+ local_path = [
40
+ os .path .join (prefix , 'lib' , 'python' ),
41
+ os .path .join (prefix , 'lib' , 'python%s.%s' % (major , minor )),
42
+ os .path .join (prefix , 'lib' , 'python%s.%s' % (major , minor ),
43
+ 'site-packages' )]
44
+ sys .path = local_path + sys .path
45
+
46
+ from stgit .main import main # noqa
47
+
47
48
start_time = time .time ()
49
+
48
50
def timer ():
49
51
return time .time () - start_time
50
52
@@ -53,4 +55,5 @@ if __name__ == '__main__':
53
55
prof .run ('main()' )
54
56
except SystemExit :
55
57
pass
56
- pstats .Stats (prof ).strip_dirs ().sort_stats (- 1 ).print_stats ().print_callees ()
58
+ stats = pstats .Stats (prof )
59
+ stats .strip_dirs ().sort_stats (- 1 ).print_stats ().print_callees ()
0 commit comments