# HG changeset patch # User Paul Boddie # Date 1240763206 -7200 # Node ID cffd1a32916e7992adb3bbb9190a7886f98dd0a7 # Parent d4374945c3f868cbbf1693808a1485bebab53ed6 Tidy built-in object suppression. Fix detail in empty and minimal tests. diff -r d4374945c3f8 -r cffd1a32916e micropython/__init__.py --- a/micropython/__init__.py Sun Apr 26 18:02:56 2009 +0200 +++ b/micropython/__init__.py Sun Apr 26 18:26:46 2009 +0200 @@ -108,6 +108,7 @@ for module in self.importer.modules_ordered: pos = len(self.code) + suppress_builtins = not with_builtins and module.name == "__builtins__" # Position the module in the image and make a translation. @@ -142,7 +143,7 @@ # Omit built-in function code where requested. - if not with_builtins and module.name == "__builtins__": + if suppress_builtins: continue # Generate the instantiator/initialiser. @@ -173,7 +174,7 @@ # Omit built-in function code where requested. - if not with_builtins and module.name == "__builtins__": + if suppress_builtins: pass # Append the function code to the image. @@ -185,7 +186,7 @@ # Omit built-in module code where requested. - if not with_builtins and module.name == "__builtins__": + if suppress_builtins: pass # Append the module top-level code to the image. diff -r d4374945c3f8 -r cffd1a32916e tests/empty.py --- a/tests/empty.py Sun Apr 26 18:02:56 2009 +0200 +++ b/tests/empty.py Sun Apr 26 18:26:46 2009 +0200 @@ -1,5 +1,5 @@ #!/usr/bin/env python -# An empty program, not even having a docstring. +"An empty program. The docstring does not contribute to the program content." # vim: tabstop=4 expandtab shiftwidth=4 diff -r d4374945c3f8 -r cffd1a32916e tests/minimal.py --- a/tests/minimal.py Sun Apr 26 18:02:56 2009 +0200 +++ b/tests/minimal.py Sun Apr 26 18:26:46 2009 +0200 @@ -1,5 +1,10 @@ #!/usr/bin/env python -"A minimal program. The docstring introduces some content." +""" +A minimal program. The docstring is not considered as part of the program +content. +""" + +"This string introduces some content." # vim: tabstop=4 expandtab shiftwidth=4