Upgrade Python to 3.9.1

Windows 7 support is dropped. Apple M1 support is added.

Bug: 176132632
Change-Id: I326b3bfaec04cac398b2e97fd48f910211adca39
diff --git a/android/bionic/config.c b/android/bionic/config.c
index 7e1705a..393913d 100644
--- a/android/bionic/config.c
+++ b/android/bionic/config.c
@@ -29,6 +29,7 @@
 extern PyObject* PyInit__contextvars(void);
 extern PyObject* PyInit_time(void);
 extern PyObject* PyInit__datetime(void);
+extern PyObject* PyInit__zoneinfo(void);
 extern PyObject* PyInit__random(void);
 extern PyObject* PyInit__bisect(void);
 extern PyObject* PyInit__heapq(void);
@@ -94,6 +95,7 @@
 extern PyObject* PyInit__io(void);
 extern PyObject* PyInit_faulthandler(void);
 extern PyObject* PyInit__tracemalloc(void);
+extern PyObject* PyInit__peg_parser(void);
 extern PyObject* PyInit__symtable(void);
 extern PyObject* PyInit_xxsubtype(void);
 
@@ -114,6 +116,7 @@
     {"_contextvars", PyInit__contextvars},
     {"time", PyInit_time},
     {"_datetime", PyInit__datetime},
+    {"_zoneinfo", PyInit__zoneinfo},
     {"_random", PyInit__random},
     {"_bisect", PyInit__bisect},
     {"_heapq", PyInit__heapq},
@@ -179,6 +182,7 @@
     {"_io", PyInit__io},
     {"faulthandler", PyInit_faulthandler},
     {"_tracemalloc", PyInit__tracemalloc},
+    {"_peg_parser", PyInit__peg_parser},
     {"_symtable", PyInit__symtable},
     {"xxsubtype", PyInit_xxsubtype},
 
diff --git a/android/bionic/pyconfig/pyconfig.h b/android/bionic/pyconfig/pyconfig.h
index 40b3386..8974547 100644
--- a/android/bionic/pyconfig/pyconfig.h
+++ b/android/bionic/pyconfig/pyconfig.h
@@ -9,6 +9,10 @@
 /* Define if building universal (internal helper macro) */
 /* #undef AC_APPLE_UNIVERSAL_BUILD */
 
+/* BUILD_GNU_TYPE + AIX_BUILDDATE are used to construct the PEP425 tag of the
+   build system. */
+/* #undef AIX_BUILDDATE */
+
 /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want
    support for AIX C++ shared extension modules. */
 /* #undef AIX_GENUINE_CPLUSPLUS */
@@ -45,10 +49,6 @@
 /* Define if getpgrp() must be called as getpgrp(0). */
 /* #undef GETPGRP_HAVE_ARG */
 
-/* Define if gettimeofday() does not have second (timezone) argument This is
-   the case on Motorola V4 (R40V4.2) */
-/* #undef GETTIMEOFDAY_NO_TZ */
-
 /* Define to 1 if you have the `accept4' function. */
 #define HAVE_ACCEPT4 1
 
@@ -516,9 +516,6 @@
 /* Define to 1 if you have the `getspnam' function. */
 #define HAVE_GETSPNAM 1
 
-/* Define to 1 if you have the `gettimeofday' function. */
-#define HAVE_GETTIMEOFDAY 1
-
 /* Define to 1 if you have the `getwd' function. */
 #define HAVE_GETWD 1
 
@@ -628,12 +625,18 @@
 /* Define to 1 if you have the <linux/can.h> header file. */
 #define HAVE_LINUX_CAN_H 1
 
+/* Define to 1 if you have the <linux/can/j1939.h> header file. */
+/* #undef HAVE_LINUX_CAN_J1939_H */
+
 /* Define if compiling using Linux 3.6 or later. */
 #define HAVE_LINUX_CAN_RAW_FD_FRAMES 1
 
 /* Define to 1 if you have the <linux/can/raw.h> header file. */
 #define HAVE_LINUX_CAN_RAW_H 1
 
+/* Define if compiling using Linux 4.1 or later. */
+/* #undef HAVE_LINUX_CAN_RAW_JOIN_FILTERS */
+
 /* Define to 1 if you have the <linux/memfd.h> header file. */
 /* #undef HAVE_LINUX_MEMFD_H */
 
@@ -652,6 +655,9 @@
 /* Define to 1 if you have the <linux/vm_sockets.h> header file. */
 /* #undef HAVE_LINUX_VM_SOCKETS_H */
 
+/* Define to 1 if you have the <linux/wait.h> header file. */
+#define HAVE_LINUX_WAIT_H 1
+
 /* Define to 1 if you have the `lockf' function. */
 #define HAVE_LOCKF 1
 
@@ -775,6 +781,9 @@
 /* Define if you have the 'prlimit' functions. */
 #define HAVE_PRLIMIT 1
 
+/* Define if you have the '_dyld_shared_cache_contains_path' function. */
+/* #undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH */
+
 /* Define to 1 if you have the <process.h> header file. */
 /* #undef HAVE_PROCESS_H */
 
@@ -805,9 +814,6 @@
 /* Define to 1 if you have the <pty.h> header file. */
 #define HAVE_PTY_H 1
 
-/* Define to 1 if you have the `putenv' function. */
-#define HAVE_PUTENV 1
-
 /* Define to 1 if you have the `pwrite' function. */
 #define HAVE_PWRITE 1
 
@@ -1266,9 +1272,6 @@
 /* Define to 1 if you have the `unlinkat' function. */
 #define HAVE_UNLINKAT 1
 
-/* Define to 1 if you have the `unsetenv' function. */
-#define HAVE_UNSETENV 1
-
 /* Define if you have a useable wchar_t type defined in wchar.h; useable means
    wchar_t must be an unsigned type with at least 16 bits. (see
    Include/unicodeobject.h). */
@@ -1385,6 +1388,9 @@
 /* Define as the preferred size in bits of long digits */
 /* #undef PYLONG_BITS_IN_DIGIT */
 
+/* enabled builtin hash modules */
+#define PY_BUILTIN_HASHLIB_HASHES "md5,sha1,sha256,sha512,sha3,blake2"
+
 /* Define if you want to coerce the C locale to a UTF-8 based locale */
 #define PY_COERCE_C_LOCALE 1
 
@@ -1525,6 +1531,10 @@
 /* Define if WINDOW in curses.h offers a field _flags. */
 #define WINDOW_HAS_FLAGS 1
 
+/* Define if you want build the _decimal module using a coroutine-local rather
+   than a thread-local context */
+#define WITH_DECIMAL_CONTEXTVAR 1
+
 /* Define if you want documentation strings in extension modules */
 #define WITH_DOC_STRINGS 1