1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 path
= os
.path
.dirname(__file__
)
10 while not os
.path
.exists(os
.path
.join(path
, 'config.status')):
11 parent
= os
.path
.normpath(os
.path
.join(path
, os
.pardir
))
13 raise Exception("Can't find config.status")
16 path
= os
.path
.join(path
, 'config.status')
17 config
= imp
.load_module('_buildconfig', open(path
), path
, ('', 'r', imp
.PY_SOURCE
))
19 for var
in os
.environ
:
20 if var
in config
.substs
:
21 config
.substs
[var
] = os
.environ
[var
]
23 for var
in config
.__all
__:
24 value
= getattr(config
, var
)
25 if isinstance(value
, list) and isinstance(value
[0], tuple):
27 setattr(sys
.modules
[__name__
], var
, value
)