Simplify par Launcher
Instead of copying some of Py_Main and changing it, use Py_Main
directly, paired with a __main__.py script that uses the runpy module to
trampoline into the user code.
Test: build/soong/python/tests/runtest.sh
Change-Id: I7f5e1e38b63b4e2ce83a85c08953a5e67c7b8788
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 0a7cd0f..1691773 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -43,11 +43,9 @@
static PyObject *ZipImportError;
static PyObject *zip_directory_cache = NULL;
-// GOOGLE(nanzhang): Changed two functions below to be visible to launcher so
-// that launcher can access the zip metadata section.
/* forward decls */
-PyObject *read_directory(const char *archive);
-PyObject *get_data(const char *archive, PyObject *toc_entry);
+static PyObject *read_directory(const char *archive);
+static PyObject *get_data(const char *archive, PyObject *toc_entry);
static PyObject *get_module_code(ZipImporter *self, char *fullname,
int *p_ispackage, char **p_modpath);
@@ -704,7 +702,7 @@
Directories can be recognized by the trailing SEP in the name,
data_size and file_offset are 0.
*/
-PyObject *
+static PyObject *
read_directory(const char *archive)
{
PyObject *files = NULL;
@@ -914,7 +912,7 @@
/* Given a path to a Zip file and a toc_entry, return the (uncompressed)
data as a new reference. */
-PyObject *
+static PyObject *
get_data(const char *archive, PyObject *toc_entry)
{
PyObject *raw_data = NULL, *data, *decompress;