diff --git a/v2/build/project.py b/v2/build/project.py index 554b55e1f..87f609fe2 100644 --- a/v2/build/project.py +++ b/v2/build/project.py @@ -1003,11 +1003,14 @@ attribute is allowed only for top-level 'project' invocations""") def import_(self, name, names_to_import=None, local_names=None): name = name[0] + py_name = name + if py_name == "os": + py_name = "os_j" jamfile_module = self.registry.current().project_module() attributes = self.registry.attributes(jamfile_module) location = attributes.get("location") - m = self.registry.load_module(name, [location]) + m = self.registry.load_module(py_name, [location]) for f in m.__dict__: v = m.__dict__[f] diff --git a/v2/util/os_j.py b/v2/util/os_j.py new file mode 100644 index 000000000..6ad22b85b --- /dev/null +++ b/v2/util/os_j.py @@ -0,0 +1,16 @@ +# Status: stub, just enough to make tests work. +# +# Named os_j to avoid conflicts with standard 'os'. See +# project.py:import for special-casing. +# +# Copyright 2001, 2002, 2003, 2005 Dave Abrahams +# Copyright 2006 Rene Rivera +# Copyright 2003, 2005 Vladimir Prus +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + + +import os + +def name(): + return os.name