Add flag to not add top-level modules to PYTHONPATH
stub_template_host.txt added all the top-level modules to the
PYTHONPATH, which isn't correct, and caused absl.logging to
override the built-in logging module.
Removing this also makes it more consistent with python binaries
built with embedded_launcher: true. embedded_launcher: true
binaries don't add the top-level modules.
Fixes: 245583294
Test: m py_dont_add_top_level_dirs_test && out/host/linux-x86/testcases/py_dont_add_top_level_dirs_test/x86_64/py_dont_add_top_level_dirs_test
Change-Id: Id3069565d2b2c4b2bda0ff5301e757a7b4201751
diff --git a/python/tests/top_level_dirs/Android.bp b/python/tests/top_level_dirs/Android.bp
new file mode 100644
index 0000000..0b15ce7
--- /dev/null
+++ b/python/tests/top_level_dirs/Android.bp
@@ -0,0 +1,9 @@
+python_test_host {
+ name: "py_dont_add_top_level_dirs_test",
+ main: "main.py",
+ srcs: [
+ "main.py",
+ "mypkg/mymodule.py",
+ ],
+ dont_add_top_level_directories_to_path: true,
+}