diff options
author | Dan Willemsen <dwillemsen@google.com> | 2019-11-04 19:21:04 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2019-11-04 19:48:19 -0800 |
commit | 8d4d7bee6d8bd398a07b0aec7043f6ee76769d4c (patch) | |
tree | d6b367bb76f9b41d337f2b3d91741d9bf6779f3b /python/tests/testpkg/par_test.py | |
parent | f66a280354c015e9b3650c95db1e74062607ceb2 (diff) |
Add python3 embedded launcher support
Test: m par_test{,3}; build/soong/python/tests/runtest.sh
Change-Id: I9c0fac9e2947616fdeedbfc55026dc3065966e71
Diffstat (limited to 'python/tests/testpkg/par_test.py')
-rw-r--r-- | python/tests/testpkg/par_test.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/python/tests/testpkg/par_test.py b/python/tests/testpkg/par_test.py index 22dd09564..ffad430e4 100644 --- a/python/tests/testpkg/par_test.py +++ b/python/tests/testpkg/par_test.py @@ -29,7 +29,13 @@ archive = sys.modules["__main__"].__loader__.archive assert_equal("__name__", __name__, "testpkg.par_test") assert_equal("__file__", __file__, os.path.join(archive, "testpkg/par_test.py")) -assert_equal("__package__", __package__, "testpkg") + +# Python3 is returning None here for me, and I haven't found any problems caused by this. +if sys.version_info[0] == 2: + assert_equal("__package__", __package__, "testpkg") +else: + assert_equal("__package__", __package__, None) + assert_equal("__loader__.archive", __loader__.archive, archive) assert_equal("__loader__.prefix", __loader__.prefix, "testpkg/") |