2 # -*- coding: utf-8 -*-
4 """Run stg with the pdb debugger."""
5 from __future__
import (absolute_import
, division
, print_function
,
12 Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com>
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License version 2 as
16 published by the Free Software Foundation.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, see http://www.gnu.org/licenses/.
27 if __name__
== '__main__':
28 # Try to detect where it is run from and set prefix and the search path.
29 # It is assumed that the user installed StGIT using the --prefix= option
30 prefix
, bin
= os
.path
.split(sys
.path
[0])
32 if bin
== 'bin' and prefix
!= sys
.prefix
:
34 sys
.exec_prefix
= prefix
36 major
, minor
= sys
.version_info
[0:2]
38 os
.path
.join(prefix
, 'lib', 'python'),
39 os
.path
.join(prefix
, 'lib', 'python%s.%s' % (major
, minor
)),
40 os
.path
.join(prefix
, 'lib', 'python%s.%s' % (major
, minor
),
42 sys
.path
= local_path
+ sys
.path
44 from stgit
.main
import main
# noqa