diff options
author | Paul m. p. P <pmpp.pub@gmail.com> | 2019-07-08 11:26:20 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-07-31 17:00:11 +1000 |
commit | a8e3201b376d931a77e66dc80293c570983f9c7b (patch) | |
tree | 9194dd6208559f73f632e6b0a751fde4ead8eea6 /tests/unix/extra_coverage.py | |
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/unix/extra_coverage.py')
-rw-r--r-- | tests/unix/extra_coverage.py | 6 |
1 files changed, 4 insertions, 2 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 |