summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons
diff options
context:
space:
mode:
authorgrbd <garlicbready@googlemail.com>2017-06-14 01:26:58 (GMT)
committergrbd <garlicbready@googlemail.com>2017-06-14 01:26:58 (GMT)
commita96ff49dee3669b25888e138916b6bb06c6dc363 (patch)
treedd3b65b425b7848c87d2480d816c64b0b3f701d1 /src/engine/SCons
parente38f013a4006c6734d57057258b96ce1367554f0 (diff)
downloadSCons-a96ff49dee3669b25888e138916b6bb06c6dc363.zip
SCons-a96ff49dee3669b25888e138916b6bb06c6dc363.tar.gz
SCons-a96ff49dee3669b25888e138916b6bb06c6dc363.tar.bz2
Nested Tool support under python 3
Diffstat (limited to 'src/engine/SCons')
-rw-r--r--src/engine/SCons/Tool/__init__.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index 7eac0e0..876b1d2 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -118,7 +118,7 @@ class Tool(object):
if hasattr(module, 'options'):
self.options = module.options
- def _load_dotted_module(self, short_name, full_name, searchpaths=None):
+ def _load_dotted_module_py2(self, short_name, full_name, searchpaths=None):
splitname = short_name.split('.')
index = 0
srchpths = searchpaths
@@ -139,7 +139,7 @@ class Tool(object):
try:
file = None
try:
- mod, file = self._load_dotted_module(self.name, self.name, self.toolpath)
+ mod, file = self._load_dotted_module_py2(self.name, self.name, self.toolpath)
return mod
finally:
if file:
@@ -179,8 +179,9 @@ class Tool(object):
found_name = self.name
add_to_scons_tools_namespace = False
for path in self.toolpath:
- file_path = os.path.join(path, "%s.py"%self.name)
- file_package = os.path.join(path, self.name)
+ sepname = self.name.replace('.', os.path.sep)
+ file_path = os.path.join(path, "%s.py"%sepname)
+ file_package = os.path.join(path, sepname)
if debug: sys.stderr.write("Trying:%s %s\n"%(file_path, file_package))
@@ -242,7 +243,7 @@ class Tool(object):
try:
smpath = sys.modules['SCons.Tool'].__path__
try:
- module, file = self._load_dotted_module(self.name, full_name, smpath)
+ module, file = self._load_dotted_module_py2(self.name, full_name, smpath)
setattr(SCons.Tool, self.name, module)
if file:
file.close()