1.1 --- a/micropython/cmd.py Tue May 08 00:29:20 2012 +0200
1.2 +++ b/micropython/cmd.py Thu May 10 22:49:44 2012 +0200
1.3 @@ -20,6 +20,7 @@
1.4 this program. If not, see <http://www.gnu.org/licenses/>.
1.5 """
1.6
1.7 +from os.path import exists, join
1.8 import micropython
1.9
1.10 def parse_optimisations(args):
1.11 @@ -53,7 +54,11 @@
1.12 i = micropython.Importer(path, verbose, requested_optimisations)
1.13 p = micropython.Program(i, requested_optimisations)
1.14
1.15 - i.load_from_file("lib/builtins.py", "__builtins__")
1.16 + for d in path:
1.17 + builtins = join(d, "builtins.py")
1.18 + if exists(builtins):
1.19 + i.load_from_file(builtins, "__builtins__")
1.20 + break
1.21 return p
1.22
1.23 # Convenience functions.