1.1 --- a/TO_DO.txt Tue May 08 00:29:20 2012 +0200
1.2 +++ b/TO_DO.txt Thu May 10 22:49:44 2012 +0200
1.3 @@ -207,6 +207,11 @@
1.4
1.5 Support __init__ traversal (and other implicit names) more effectively.
1.6
1.7 +Importing Modules
1.8 +=================
1.9 +
1.10 +Consider supporting relative imports, even though this is arguably a misfeature.
1.11 +
1.12 Other
1.13 =====
1.14
2.1 --- a/micropython/cmd.py Tue May 08 00:29:20 2012 +0200
2.2 +++ b/micropython/cmd.py Thu May 10 22:49:44 2012 +0200
2.3 @@ -20,6 +20,7 @@
2.4 this program. If not, see <http://www.gnu.org/licenses/>.
2.5 """
2.6
2.7 +from os.path import exists, join
2.8 import micropython
2.9
2.10 def parse_optimisations(args):
2.11 @@ -53,7 +54,11 @@
2.12 i = micropython.Importer(path, verbose, requested_optimisations)
2.13 p = micropython.Program(i, requested_optimisations)
2.14
2.15 - i.load_from_file("lib/builtins.py", "__builtins__")
2.16 + for d in path:
2.17 + builtins = join(d, "builtins.py")
2.18 + if exists(builtins):
2.19 + i.load_from_file(builtins, "__builtins__")
2.20 + break
2.21 return p
2.22
2.23 # Convenience functions.