diff options
| author | Paul m. p. P | 2019-07-08 11:26:20 +0200 |
|---|---|---|
| committer | Damien George | 2019-07-31 17:00:11 +1000 |
| commit | a8e3201b376d931a77e66dc80293c570983f9c7b (patch) | |
| tree | 9194dd6208559f73f632e6b0a751fde4ead8eea6 /tests | |
| parent | 7c15e50eb880f7246fca3fdd11c967b151117ddf (diff) | |
py/builtinimport: Populate __file__ when importing frozen or mpy files.
Note that bytecode already includes the source filename as a qstr so there
is no additional memory used by the interning operation here.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unix/extra_coverage.py | 6 | ||||
| -rw-r--r-- | tests/unix/extra_coverage.py.exp | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/tests/unix/extra_coverage.py b/tests/unix/extra_coverage.py index 13721f1f4..cb68bae4d 100644 --- a/tests/unix/extra_coverage.py +++ b/tests/unix/extra_coverage.py @@ -48,13 +48,15 @@ print(buf.write(bytearray(16))) # test basic import of frozen scripts import frzstr1 +print(frzstr1.__file__) import frzmpy1 +print(frzmpy1.__file__) # test import of frozen packages with __init__.py import frzstr_pkg1 -print(frzstr_pkg1.x) +print(frzstr_pkg1.__file__, frzstr_pkg1.x) import frzmpy_pkg1 -print(frzmpy_pkg1.x) +print(frzmpy_pkg1.__file__, frzmpy_pkg1.x) # test import of frozen packages without __init__.py from frzstr_pkg2.mod import Foo diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index 6c483f7e5..a9889c0e9 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -94,11 +94,13 @@ OSError None None frzstr1 +frzstr1.py frzmpy1 +frzmpy1.py frzstr_pkg1.__init__ -1 +frzstr_pkg1/__init__.py 1 frzmpy_pkg1.__init__ -1 +frzmpy_pkg1/__init__.py 1 frzstr_pkg2.mod 1 frzmpy_pkg2.mod |
