1.1 --- a/micropython/__init__.py Sun Apr 26 18:02:56 2009 +0200
1.2 +++ b/micropython/__init__.py Sun Apr 26 18:26:46 2009 +0200
1.3 @@ -108,6 +108,7 @@
1.4
1.5 for module in self.importer.modules_ordered:
1.6 pos = len(self.code)
1.7 + suppress_builtins = not with_builtins and module.name == "__builtins__"
1.8
1.9 # Position the module in the image and make a translation.
1.10
1.11 @@ -142,7 +143,7 @@
1.12
1.13 # Omit built-in function code where requested.
1.14
1.15 - if not with_builtins and module.name == "__builtins__":
1.16 + if suppress_builtins:
1.17 continue
1.18
1.19 # Generate the instantiator/initialiser.
1.20 @@ -173,7 +174,7 @@
1.21
1.22 # Omit built-in function code where requested.
1.23
1.24 - if not with_builtins and module.name == "__builtins__":
1.25 + if suppress_builtins:
1.26 pass
1.27
1.28 # Append the function code to the image.
1.29 @@ -185,7 +186,7 @@
1.30
1.31 # Omit built-in module code where requested.
1.32
1.33 - if not with_builtins and module.name == "__builtins__":
1.34 + if suppress_builtins:
1.35 pass
1.36
1.37 # Append the module top-level code to the image.
2.1 --- a/tests/empty.py Sun Apr 26 18:02:56 2009 +0200
2.2 +++ b/tests/empty.py Sun Apr 26 18:26:46 2009 +0200
2.3 @@ -1,5 +1,5 @@
2.4 #!/usr/bin/env python
2.5
2.6 -# An empty program, not even having a docstring.
2.7 +"An empty program. The docstring does not contribute to the program content."
2.8
2.9 # vim: tabstop=4 expandtab shiftwidth=4
3.1 --- a/tests/minimal.py Sun Apr 26 18:02:56 2009 +0200
3.2 +++ b/tests/minimal.py Sun Apr 26 18:26:46 2009 +0200
3.3 @@ -1,5 +1,10 @@
3.4 #!/usr/bin/env python
3.5
3.6 -"A minimal program. The docstring introduces some content."
3.7 +"""
3.8 +A minimal program. The docstring is not considered as part of the program
3.9 +content.
3.10 +"""
3.11 +
3.12 +"This string introduces some content."
3.13
3.14 # vim: tabstop=4 expandtab shiftwidth=4