1.1 --- a/test.py Wed Feb 06 01:28:11 2008 +0100
1.2 +++ b/test.py Sat Feb 09 02:35:57 2008 +0100
1.3 @@ -8,13 +8,18 @@
1.4 print i, x
1.5
1.6 i = micropython.Importer(sys.path, "-v" in sys.argv)
1.7 -if len(sys.argv) < 2:
1.8 - m = i.load("micropython")
1.9 - #m = i.load_from_file("micropython/__init__.py")
1.10 +try:
1.11 + if len(sys.argv) < 2:
1.12 + m = i.load("micropython")
1.13 + #m = i.load_from_file("micropython/__init__.py")
1.14 + else:
1.15 + m = i.load_from_file(sys.argv[1])
1.16 +except micropython.InspectError, exc:
1.17 + print "At line", exc.node.lineno, "the following error occurred:"
1.18 + print exc.message
1.19 else:
1.20 - m = i.load_from_file(sys.argv[1])
1.21 -i.vacuum()
1.22 -ot = i.get_object_table()
1.23 -pt = i.get_parameter_table()
1.24 + i.vacuum()
1.25 + ot = i.get_object_table()
1.26 + pt = i.get_parameter_table()
1.27
1.28 # vim: tabstop=4 expandtab shiftwidth=4