diff options
Diffstat (limited to 'tests/import/import-pkg1.py')
-rw-r--r-- | tests/import/import-pkg1.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/import/import-pkg1.py b/tests/import/import-pkg1.py new file mode 100644 index 0000000000..8cd77af79d --- /dev/null +++ b/tests/import/import-pkg1.py @@ -0,0 +1,11 @@ +import pkg.mod + +print(pkg.__name__) +print(pkg.mod.__name__) +print(pkg.mod.foo()) + +# Import 2nd time, must be same module objects +pkg_ = __import__("pkg.mod") +print(pkg_ is not pkg.mod) +print(pkg_ is pkg) +print(pkg_.mod is pkg.mod) |