mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
Experiment with making Python go faster
The goal is to put the compiled pyc files in the APE ZIP.
This commit is contained in:
parent
4486ad5c9e
commit
ebb8c85496
33 changed files with 9483 additions and 1859 deletions
Binary file not shown.
92
libc/x/utf8toutf32.c
Normal file
92
libc/x/utf8toutf32.c
Normal file
|
@ -0,0 +1,92 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2021 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
│ above copyright notice and this permission notice appear in all copies. │
|
||||
│ │
|
||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/pcmpgtb.h"
|
||||
#include "libc/intrin/pmovmskb.h"
|
||||
#include "libc/intrin/punpckhbw.h"
|
||||
#include "libc/intrin/punpckhwd.h"
|
||||
#include "libc/intrin/punpcklbw.h"
|
||||
#include "libc/intrin/punpcklwd.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/str/thompike.h"
|
||||
#include "libc/str/utf16.h"
|
||||
#include "libc/x/x.h"
|
||||
|
||||
/**
|
||||
* Transcodes UTF-8 to UTF-32.
|
||||
*
|
||||
* @param p is input value
|
||||
* @param n if -1 implies strlen
|
||||
* @param z if non-NULL receives output length
|
||||
*/
|
||||
wchar_t *utf8toutf32(const char *p, size_t n, size_t *z) {
|
||||
size_t i;
|
||||
unsigned m, j;
|
||||
wint_t x, a, b;
|
||||
wchar_t *r, *q;
|
||||
uint8_t v1[16], v2[16], v3[16], v4[16], vz[16];
|
||||
if (z) *z = 0;
|
||||
if (n == -1) n = p ? strlen(p) : 0;
|
||||
if ((q = r = malloc(n * sizeof(wchar_t) + sizeof(wchar_t)))) {
|
||||
for (i = 0; i < n;) {
|
||||
if (0 && i + 16 < n) { /* 10x speedup for ascii */
|
||||
memset(vz, 0, 16);
|
||||
do {
|
||||
memcpy(v1, p + i, 16);
|
||||
pcmpgtb((int8_t *)v2, (int8_t *)v1, (int8_t *)vz);
|
||||
if (pmovmskb(v2) != 0xFFFF) break;
|
||||
punpcklbw(v3, v1, vz);
|
||||
punpckhbw(v1, v1, vz);
|
||||
punpcklwd((void *)v4, (void *)v3, (void *)vz);
|
||||
punpckhwd((void *)v3, (void *)v3, (void *)vz);
|
||||
punpcklwd((void *)v2, (void *)v1, (void *)vz);
|
||||
punpckhwd((void *)v1, (void *)v1, (void *)vz);
|
||||
memcpy(q + 0, v4, 16);
|
||||
memcpy(q + 4, v3, 16);
|
||||
memcpy(q + 8, v2, 16);
|
||||
memcpy(q + 12, v1, 16);
|
||||
i += 16;
|
||||
q += 16;
|
||||
} while (i + 16 < n);
|
||||
}
|
||||
x = p[i++] & 0xff;
|
||||
if (x >= 0300) {
|
||||
a = ThomPikeByte(x);
|
||||
m = ThomPikeLen(x) - 1;
|
||||
if (i + m <= n) {
|
||||
for (j = 0;;) {
|
||||
b = p[i + j] & 0xff;
|
||||
if (!ThomPikeCont(b)) break;
|
||||
a = ThomPikeMerge(a, b);
|
||||
if (++j == m) {
|
||||
x = a;
|
||||
i += j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*q++ = x;
|
||||
}
|
||||
if (z) *z = q - r;
|
||||
*q++ = '\0';
|
||||
if ((q = realloc(r, (q - r) * sizeof(wchar_t)))) r = q;
|
||||
}
|
||||
return r;
|
||||
}
|
|
@ -53,7 +53,9 @@ void *xunbinga(size_t, const char16_t *) attributeallocalign((1)) _XMAL _XRET;
|
|||
void *xunbing(const char16_t *) _XMAL _XRET;
|
||||
char16_t *utf8toutf16(const char *, size_t, size_t *) nodiscard;
|
||||
char *utf16toutf8(const char16_t *, size_t, size_t *) nodiscard;
|
||||
wchar_t *utf8toutf32(const char *, size_t, size_t *) nodiscard;
|
||||
char *xhomedir(void) nodiscard;
|
||||
char *xstripexts(const char *) nodiscard;
|
||||
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
│ cosmopolitan § eXtended apis » files ─╬─│┼
|
||||
|
|
30
libc/x/xstripexts.c
Normal file
30
libc/x/xstripexts.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2021 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
│ above copyright notice and this permission notice appear in all copies. │
|
||||
│ │
|
||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/x/x.h"
|
||||
|
||||
/**
|
||||
* Removes file extensions.
|
||||
*
|
||||
* @param s is mutated
|
||||
* @return s
|
||||
*/
|
||||
char *xstripexts(const char *s) {
|
||||
return stripexts(xstrdup(s));
|
||||
}
|
|
@ -26,8 +26,13 @@
|
|||
* @asyncsignalsafe
|
||||
*/
|
||||
int __zipos_fstat(const struct ZiposHandle *h, struct stat *st) {
|
||||
ZTRACE("__zipos_fstat(%`'.*s)",
|
||||
int rc;
|
||||
if (!(rc = __zipos_stat_impl(__zipos_get(), h->cfile, st))) {
|
||||
ZTRACE("__zipos_fstat(%`'.*s) → %ld",
|
||||
ZIP_CFILE_NAMESIZE(__zipos_get()->map + h->cfile),
|
||||
ZIP_CFILE_NAME(__zipos_get()->map + h->cfile));
|
||||
return __zipos_stat_impl(__zipos_get(), h->cfile, st);
|
||||
ZIP_CFILE_NAME(__zipos_get()->map + h->cfile), st->st_size);
|
||||
return 0;
|
||||
} else {
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/x/x.h"
|
||||
|
||||
TEST(stripexts, test) {
|
||||
char s[] = "foo/bar.com.dbg";
|
||||
|
@ -29,3 +31,11 @@ TEST(stripexts, test2) {
|
|||
char s[] = "foo/bar.com.dbg";
|
||||
EXPECT_STREQ("bar", stripexts(basename(s)));
|
||||
}
|
||||
|
||||
TEST(xstripexts, test) {
|
||||
EXPECT_STREQ("foo/bar", gc(xstripexts("foo/bar.com.dbg")));
|
||||
}
|
||||
|
||||
TEST(xstripexts, test2) {
|
||||
EXPECT_STREQ("bar", gc(xstripexts(basename("foo/bar.com.dbg"))));
|
||||
}
|
||||
|
|
53
test/libc/x/utf8toutf32_test.c
Normal file
53
test/libc/x/utf8toutf32_test.c
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2021 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
│ above copyright notice and this permission notice appear in all copies. │
|
||||
│ │
|
||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/hyperion.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/x/x.h"
|
||||
|
||||
TEST(utf8toutf32, test) {
|
||||
EXPECT_STREQ(L"", gc(utf8toutf32(0, 0, 0)));
|
||||
EXPECT_STREQ(L"", gc(utf8toutf32("", -1, 0)));
|
||||
EXPECT_STREQ(L"hello", gc(utf8toutf32("hello", -1, 0)));
|
||||
}
|
||||
|
||||
TEST(utf8toutf32, testLargeAscii) {
|
||||
EXPECT_STREQ(L"hellohellohelloz", gc(utf8toutf32("hellohellohelloz", -1, 0)));
|
||||
EXPECT_STREQ(L"hellohellohellozhellohellohelloz",
|
||||
gc(utf8toutf32("hellohellohellozhellohellohelloz", -1, 0)));
|
||||
}
|
||||
|
||||
TEST(utf8toutf32, testLargeThompsonPikeEncoded) {
|
||||
EXPECT_STREQ(L"hellohellohello𝑧hellohellohelloz",
|
||||
gc(utf8toutf32("hellohellohello𝑧hellohellohelloz", -1, 0)));
|
||||
EXPECT_STREQ(L"hellohellohelloh𝑧ellohellohelloz",
|
||||
gc(utf8toutf32("hellohellohelloh𝑧ellohellohelloz", -1, 0)));
|
||||
EXPECT_STREQ(
|
||||
L"𝑒𝑙𝑙𝑜𝑒𝑙𝑙𝑜𝑒𝑙𝑙𝑜𝑧",
|
||||
gc(utf8toutf32(
|
||||
"𝑒𝑙𝑙𝑜𝑒𝑙𝑙𝑜𝑒𝑙𝑙𝑜𝑧",
|
||||
-1, 0)));
|
||||
}
|
||||
|
||||
BENCH(utf8toutf32, bench) {
|
||||
EZBENCH2("utf8toutf32", donothing,
|
||||
free(utf8toutf32(kHyperion, kHyperionSize, 0)));
|
||||
}
|
|
@ -29,6 +29,6 @@ TEST(StripComponents, test) {
|
|||
EXPECT_STREQ("hello", StripComponents("a/b/hello", 3));
|
||||
EXPECT_STREQ("hello", StripComponents("a/b/hello", 2));
|
||||
EXPECT_STREQ("b/hello", StripComponents("a/b/hello", 1));
|
||||
EXPECT_STREQ("hello", StripComponents("a///b/hello", 2));
|
||||
EXPECT_STREQ("b/hello", StripComponents("///a/b/hello", 1));
|
||||
EXPECT_STREQ("/foo/bar", StripComponents("o//foo/bar", 1));
|
||||
EXPECT_STREQ("foo/bar", StripComponents("o//foo/bar", 2));
|
||||
}
|
||||
|
|
1
third_party/python/Include/pythonrun.h
vendored
1
third_party/python/Include/pythonrun.h
vendored
|
@ -1,5 +1,6 @@
|
|||
#ifndef Py_PYTHONRUN_H
|
||||
#define Py_PYTHONRUN_H
|
||||
#include "third_party/python/Include/code.h"
|
||||
#include "third_party/python/Include/object.h"
|
||||
#include "third_party/python/Include/pyarena.h"
|
||||
#include "third_party/python/Include/pystate.h"
|
||||
|
|
2
third_party/python/Lib/site.py
vendored
2
third_party/python/Lib/site.py
vendored
|
@ -525,12 +525,10 @@ def execusercustomize():
|
|||
|
||||
def main():
|
||||
"""Add standard site-specific directories to the module search path.
|
||||
|
||||
This function is called automatically when this module is imported,
|
||||
unless the python interpreter was started with the -S flag.
|
||||
"""
|
||||
global ENABLE_USER_SITE
|
||||
|
||||
abs_paths()
|
||||
known_paths = removeduppaths()
|
||||
known_paths = venv(known_paths)
|
||||
|
|
41
third_party/python/Modules/getpath.c
vendored
41
third_party/python/Modules/getpath.c
vendored
|
@ -466,6 +466,7 @@ search_for_exec_prefix(wchar_t *argv0_path, wchar_t *home,
|
|||
static void
|
||||
calculate_path(void)
|
||||
{
|
||||
#if 0
|
||||
static wchar_t delimiter[2] = {DELIM, '\0'};
|
||||
static wchar_t separator[2] = {SEP, '\0'};
|
||||
/* ignore PYTHONPATH/PYTHONHOME for now */
|
||||
|
@ -486,21 +487,17 @@ calculate_path(void)
|
|||
size_t ape_length;
|
||||
wchar_t ape_lib_path[MAXPATHLEN+1];
|
||||
wchar_t ape_exec_path[MAXPATHLEN+1];
|
||||
|
||||
wchar_t package_path[MAXPATHLEN+1];
|
||||
wchar_t ape_package_path[MAXPATHLEN+1];
|
||||
|
||||
if(IsWindows())
|
||||
{
|
||||
delimiter[0] = L';';
|
||||
separator[0] = L'\\';
|
||||
}
|
||||
|
||||
if (_path) {
|
||||
path_buffer = Py_DecodeLocale(_path, NULL);
|
||||
path = path_buffer;
|
||||
}
|
||||
|
||||
/* If there is no slash in the argv0 path, then we have to
|
||||
* assume python is on the user's $PATH, since there's no
|
||||
* other way to find a directory to start the search from. If
|
||||
|
@ -511,7 +508,6 @@ calculate_path(void)
|
|||
else if (path) {
|
||||
while (1) {
|
||||
wchar_t *delim = wcschr(path, DELIM);
|
||||
|
||||
if (delim) {
|
||||
size_t len = delim - path;
|
||||
if (len > MAXPATHLEN)
|
||||
|
@ -521,11 +517,9 @@ calculate_path(void)
|
|||
}
|
||||
else
|
||||
wcsncpy(progpath, path, MAXPATHLEN);
|
||||
|
||||
joinpath(progpath, prog);
|
||||
if (isxfile(progpath))
|
||||
break;
|
||||
|
||||
if (!delim) {
|
||||
progpath[0] = L'\0';
|
||||
break;
|
||||
|
@ -540,27 +534,21 @@ calculate_path(void)
|
|||
absolutize(progpath);
|
||||
wcsncpy(argv0_path, progpath, MAXPATHLEN);
|
||||
argv0_path[MAXPATHLEN] = '\0';
|
||||
|
||||
reduce(argv0_path);
|
||||
/* At this point, argv0_path is guaranteed to be less than
|
||||
MAXPATHLEN bytes long.
|
||||
*/
|
||||
|
||||
/* not searching for pyvenv.cfg */
|
||||
|
||||
/* Avoid absolute path for prefix */
|
||||
wcsncpy(prefix,
|
||||
L"third_party/python/Lib",
|
||||
MAXPATHLEN);
|
||||
/* wcsncpy(prefix, */
|
||||
/* L"zip!third_party/python/Lib/", */
|
||||
/* MAXPATHLEN); */
|
||||
|
||||
wcsncpy(prefix,
|
||||
L"zip!.python",
|
||||
MAXPATHLEN);
|
||||
/* Avoid absolute path for exec_prefix */
|
||||
wcsncpy(exec_prefix, L"build/lib.linux-x86_64-3.6", MAXPATHLEN);
|
||||
|
||||
wcsncpy(package_path, L"Lib/site-packages", MAXPATHLEN);
|
||||
|
||||
// printf("progpath = %ls, prog = %ls\n", progpath, prog);
|
||||
/* add paths for the internal store of the APE */
|
||||
if(wcslen(progpath) > 0 && wcslen(progpath) + 1 < MAXPATHLEN)
|
||||
|
@ -568,7 +556,6 @@ calculate_path(void)
|
|||
else
|
||||
wcsncpy(ape_path, prog, MAXPATHLEN);
|
||||
ape_length = wcslen(ape_path);
|
||||
|
||||
wcsncpy(ape_lib_path, ape_path, MAXPATHLEN);
|
||||
// extra 1 at the start for the slash
|
||||
if(ape_length + 1 + wcslen(prefix) + 1 < MAXPATHLEN)
|
||||
|
@ -576,24 +563,20 @@ calculate_path(void)
|
|||
ape_lib_path[ape_length] = L'/';
|
||||
wcscat(ape_lib_path + ape_length + 1, prefix);
|
||||
}
|
||||
|
||||
wcsncpy(ape_exec_path, ape_path, MAXPATHLEN);
|
||||
if(ape_length + 1 + wcslen(exec_prefix) + 1 < MAXPATHLEN)
|
||||
{
|
||||
ape_exec_path[ape_length] = L'/';
|
||||
wcscat(ape_exec_path + ape_length + 1, exec_prefix);
|
||||
}
|
||||
|
||||
wcsncpy(ape_package_path, ape_path, MAXPATHLEN);
|
||||
if(ape_length + 1 + wcslen(package_path) + 1 < MAXPATHLEN)
|
||||
{
|
||||
ape_package_path[ape_length] = L'/';
|
||||
wcscat(ape_package_path + ape_length + 1, package_path);
|
||||
}
|
||||
|
||||
/* Calculate size of return buffer */
|
||||
bufsz = 0;
|
||||
|
||||
bufsz += wcslen(ape_lib_path) + 1;
|
||||
bufsz += wcslen(ape_exec_path) + 1;
|
||||
bufsz += wcslen(ape_package_path) + 1;
|
||||
|
@ -601,44 +584,36 @@ calculate_path(void)
|
|||
bufsz += wcslen(prefix) + 1;
|
||||
bufsz += wcslen(exec_prefix) + 1;
|
||||
bufsz += wcslen(package_path) + 1;
|
||||
|
||||
/* This is the only malloc call in this file */
|
||||
buf = PyMem_RawMalloc(bufsz * sizeof(wchar_t));
|
||||
if (buf == NULL) {
|
||||
Py_FatalError(
|
||||
"Not enough memory for dynamic PYTHONPATH");
|
||||
}
|
||||
|
||||
buf[0] = L'\0';
|
||||
|
||||
wcscat(buf, prefix);
|
||||
wcscat(buf, delimiter);
|
||||
|
||||
wcscat(buf, package_path);
|
||||
wcscat(buf, delimiter);
|
||||
|
||||
wcscat(buf, ape_lib_path);
|
||||
wcscat(buf, delimiter);
|
||||
|
||||
wcscat(buf, ape_package_path);
|
||||
wcscat(buf, delimiter);
|
||||
|
||||
wcscat(buf, ape_exec_path);
|
||||
wcscat(buf, delimiter);
|
||||
|
||||
wcscat(buf, ape_path);
|
||||
wcscat(buf, delimiter);
|
||||
|
||||
|
||||
/* Finally, on goes the directory for dynamic-load modules */
|
||||
wcscat(buf, exec_prefix);
|
||||
|
||||
/* And publish the results */
|
||||
module_search_path = buf;
|
||||
// printf("%ls\n", buf);
|
||||
#else
|
||||
module_search_path = L"zip!.python/";
|
||||
/* module_search_path = L"third_party/python/Lib/"; */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* External interface */
|
||||
void
|
||||
Py_SetPath(const wchar_t *path)
|
||||
|
|
33
third_party/python/Objects/unicodeislinebreak.c
vendored
Normal file
33
third_party/python/Objects/unicodeislinebreak.c
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "third_party/python/Include/unicodeobject.h"
|
||||
/* clang-format off */
|
||||
|
||||
/**
|
||||
* Returns 1 for Unicode characters having the line break
|
||||
* property 'BK', 'CR', 'LF' or 'NL' or having bidirectional
|
||||
* type 'B', 0 otherwise.
|
||||
*/
|
||||
int _PyUnicode_IsLinebreak(const Py_UCS4 ch)
|
||||
{
|
||||
switch (ch) {
|
||||
case 0x000A:
|
||||
case 0x000B:
|
||||
case 0x000C:
|
||||
case 0x000D:
|
||||
case 0x001C:
|
||||
case 0x001D:
|
||||
case 0x001E:
|
||||
case 0x0085:
|
||||
case 0x2028:
|
||||
case 0x2029:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
51
third_party/python/Objects/unicodeiswhitespace.c
vendored
Normal file
51
third_party/python/Objects/unicodeiswhitespace.c
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "third_party/python/Include/unicodeobject.h"
|
||||
/* clang-format off */
|
||||
|
||||
/**
|
||||
* Returns 1 for Unicode characters having the bidirectional
|
||||
* type 'WS', 'B' or 'S' or the category 'Zs', 0 otherwise.
|
||||
*/
|
||||
int _PyUnicode_IsWhitespace(const Py_UCS4 ch)
|
||||
{
|
||||
switch (ch) {
|
||||
case 0x0009:
|
||||
case 0x000A:
|
||||
case 0x000B:
|
||||
case 0x000C:
|
||||
case 0x000D:
|
||||
case 0x001C:
|
||||
case 0x001D:
|
||||
case 0x001E:
|
||||
case 0x001F:
|
||||
case 0x0020:
|
||||
case 0x0085:
|
||||
case 0x00A0:
|
||||
case 0x1680:
|
||||
case 0x2000:
|
||||
case 0x2001:
|
||||
case 0x2002:
|
||||
case 0x2003:
|
||||
case 0x2004:
|
||||
case 0x2005:
|
||||
case 0x2006:
|
||||
case 0x2007:
|
||||
case 0x2008:
|
||||
case 0x2009:
|
||||
case 0x200A:
|
||||
case 0x2028:
|
||||
case 0x2029:
|
||||
case 0x202F:
|
||||
case 0x205F:
|
||||
case 0x3000:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
2
third_party/python/Objects/unicodeobject.c
vendored
2
third_party/python/Objects/unicodeobject.c
vendored
|
@ -5030,7 +5030,7 @@ PyUnicode_DecodeUTF8(const char *s,
|
|||
# error C 'long' size should be either 4 or 8!
|
||||
#endif
|
||||
|
||||
static Py_ssize_t
|
||||
static optimizespeed Py_ssize_t
|
||||
ascii_decode(const char *start, const char *end, Py_UCS1 *dest)
|
||||
{
|
||||
const char *p = start;
|
||||
|
|
1851
third_party/python/Objects/unicodetonumeric.c
vendored
Normal file
1851
third_party/python/Objects/unicodetonumeric.c
vendored
Normal file
File diff suppressed because it is too large
Load diff
1788
third_party/python/Objects/unicodetype_db.inc
vendored
1788
third_party/python/Objects/unicodetype_db.inc
vendored
File diff suppressed because it is too large
Load diff
2
third_party/python/Parser/acceler.c
vendored
2
third_party/python/Parser/acceler.c
vendored
|
@ -65,7 +65,7 @@ fixdfa(grammar *g, dfa *d)
|
|||
fixstate(g, s);
|
||||
}
|
||||
|
||||
static void
|
||||
static optimizespeed void
|
||||
fixstate(grammar *g, state *s)
|
||||
{
|
||||
arc *a;
|
||||
|
|
|
@ -4,22 +4,40 @@
|
|||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "third_party/python/Include/bytesobject.h"
|
||||
#include "third_party/python/Include/compile.h"
|
||||
#include "third_party/python/Include/fileutils.h"
|
||||
#include "third_party/python/Include/import.h"
|
||||
#include "third_party/python/Include/marshal.h"
|
||||
#include "third_party/python/Include/pydebug.h"
|
||||
#include "third_party/python/Include/pylifecycle.h"
|
||||
#include "third_party/python/Include/pymacro.h"
|
||||
#include "third_party/python/Include/pythonrun.h"
|
||||
/* clang-format off */
|
||||
|
||||
#define HEADER "\
|
||||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│\n\
|
||||
│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│\n\
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡\n\
|
||||
│ Python 3 │\n\
|
||||
│ https://docs.python.org/3/license.html │\n\
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/\n\
|
||||
/* clang-format off */\n\
|
||||
\n\
|
||||
/*\n\
|
||||
* Auto-generated by\n\
|
||||
* %s \\\n\
|
||||
* %s \\\n\
|
||||
* %s\n\
|
||||
*/\n\
|
||||
\n\
|
||||
"
|
||||
|
||||
/* This is built as a stand-alone executable by the Makefile, and helps turn
|
||||
Lib/importlib/_bootstrap.py into a frozen module in Python/importlib.h
|
||||
*/
|
||||
|
||||
#include <Python.h>
|
||||
#include <marshal.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifndef MS_WINDOWS
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* To avoid a circular dependency on frozen.o, we create our own structure
|
||||
of frozen modules instead, left deliberately blank so as to avoid
|
||||
unintentional import of a stale version of _frozen_importlib. */
|
||||
|
@ -35,7 +53,25 @@ static const struct _frozen _PyImport_FrozenModules[] = {
|
|||
const struct _frozen *PyImport_FrozenModules;
|
||||
#endif
|
||||
|
||||
const char header[] = "/* Auto-generated by Programs/_freeze_importlib.c */";
|
||||
PyObject *PyMarshal_Init(void);
|
||||
PyObject *PyInit_gc(void);
|
||||
PyObject *PyInit__ast(void);
|
||||
PyObject *_PyWarnings_Init(void);
|
||||
PyObject *PyInit__string(void);
|
||||
|
||||
struct _inittab _PyImport_Inittab[] = {
|
||||
{"marshal", PyMarshal_Init},
|
||||
{"_imp", PyInit_imp},
|
||||
{"_ast", PyInit__ast},
|
||||
{"builtins"},
|
||||
{"sys"},
|
||||
{"gc", PyInit_gc},
|
||||
{"_warnings", _PyWarnings_Init},
|
||||
{"_string", PyInit__string},
|
||||
{0}
|
||||
};
|
||||
|
||||
struct _inittab *PyImport_Inittab = _PyImport_Inittab;
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
|
@ -120,7 +156,7 @@ main(int argc, char *argv[])
|
|||
fprintf(stderr, "cannot open '%s' for writing\n", outpath);
|
||||
goto error;
|
||||
}
|
||||
fprintf(outfile, "%s\n", header);
|
||||
fprintf(outfile, HEADER, argv[0], argv[1], argv[2]);
|
||||
if (is_bootstrap)
|
||||
fprintf(outfile, "const unsigned char _Py_M__importlib[] = {\n");
|
||||
else
|
3
third_party/python/Programs/python.c
vendored
3
third_party/python/Programs/python.c
vendored
|
@ -27,6 +27,9 @@
|
|||
#include "third_party/python/Include/unicodeobject.h"
|
||||
/* clang-format off */
|
||||
|
||||
extern struct _inittab _PyImport_Inittab[];
|
||||
struct _inittab *PyImport_Inittab = _PyImport_Inittab;
|
||||
|
||||
static jmp_buf jbuf;
|
||||
|
||||
static void
|
||||
|
|
3
third_party/python/Python/codecs.c
vendored
3
third_party/python/Python/codecs.c
vendored
|
@ -1556,6 +1556,9 @@ static int _PyCodecRegistry_Init(void)
|
|||
interp->codec_error_registry == NULL)
|
||||
Py_FatalError("can't initialize codec registry");
|
||||
|
||||
/*
|
||||
* XXX: terrible design!
|
||||
*/
|
||||
mod = PyImport_ImportModuleNoBlock("encodings");
|
||||
if (mod == NULL) {
|
||||
return -1;
|
||||
|
|
5
third_party/python/Python/import.c
vendored
5
third_party/python/Python/import.c
vendored
|
@ -40,11 +40,6 @@
|
|||
/* See _PyImport_FixupExtensionObject() below */
|
||||
static PyObject *extensions = NULL;
|
||||
|
||||
/* This table is defined in config.c: */
|
||||
extern struct _inittab _PyImport_Inittab[];
|
||||
|
||||
struct _inittab *PyImport_Inittab = _PyImport_Inittab;
|
||||
|
||||
static PyObject *initstr = NULL;
|
||||
|
||||
/*[clinic input]
|
||||
|
|
7
third_party/python/Python/importlib.inc
vendored
7
third_party/python/Python/importlib.inc
vendored
|
@ -6,7 +6,12 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
/* clang-format off */
|
||||
|
||||
/* Auto-generated by Programs/_freeze_importlib.c */
|
||||
/*
|
||||
* Auto-generated by
|
||||
* m/third_party/python/freeze.com \
|
||||
* third_party/python/Lib/importlib/_bootstrap.py \
|
||||
* third_party/python/Python/importlib.inc
|
||||
*/
|
||||
|
||||
const unsigned char _Py_M__importlib[] = {
|
||||
99,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,
|
||||
|
|
|
@ -6,7 +6,12 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
/* clang-format off */
|
||||
|
||||
/* Auto-generated by Programs/_freeze_importlib.c */
|
||||
/*
|
||||
* Auto-generated by
|
||||
* m/third_party/python/freeze.com \
|
||||
* third_party/python/Lib/importlib/_bootstrap_external.py \
|
||||
* third_party/python/Python/importlib_external.inc
|
||||
*/
|
||||
|
||||
const unsigned char _Py_M__importlib_external[] = {
|
||||
99,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,
|
||||
|
|
3
third_party/python/Python/pylifecycle.c
vendored
3
third_party/python/Python/pylifecycle.c
vendored
|
@ -305,7 +305,8 @@ import_init(PyInterpreterState *interp, PyObject *sysmod)
|
|||
Py_DECREF(value);
|
||||
Py_DECREF(impmod);
|
||||
|
||||
_PyImportZip_Init();
|
||||
/* just add zip!.python/ to sys.path */
|
||||
/* _PyImportZip_Init(); */
|
||||
}
|
||||
|
||||
|
||||
|
|
2
third_party/python/Python/pythonrun.c
vendored
2
third_party/python/Python/pythonrun.c
vendored
|
@ -4,6 +4,7 @@
|
|||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "third_party/python/Include/Python-ast.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
|
@ -26,6 +27,7 @@
|
|||
#include "third_party/python/Include/pydebug.h"
|
||||
#include "third_party/python/Include/pyerrors.h"
|
||||
#include "third_party/python/Include/pylifecycle.h"
|
||||
#include "third_party/python/Include/pythonrun.h"
|
||||
#include "third_party/python/Include/setobject.h"
|
||||
#include "third_party/python/Include/symtable.h"
|
||||
#include "third_party/python/Include/sysmodule.h"
|
||||
|
|
654
third_party/python/makegen.py
vendored
Normal file
654
third_party/python/makegen.py
vendored
Normal file
|
@ -0,0 +1,654 @@
|
|||
import os
|
||||
|
||||
PYCOMP = "o/$(MODE)/third_party/python/pycomp"
|
||||
|
||||
SAUCES = (
|
||||
"third_party/python/Lib",
|
||||
"third_party/python/Lib/__future__.py",
|
||||
"third_party/python/Lib/_bootlocale.py",
|
||||
"third_party/python/Lib/_collections_abc.py",
|
||||
"third_party/python/Lib/_compat_pickle.py",
|
||||
"third_party/python/Lib/_compression.py",
|
||||
"third_party/python/Lib/_dummy_thread.py",
|
||||
"third_party/python/Lib/_markupbase.py",
|
||||
"third_party/python/Lib/_osx_support.py",
|
||||
"third_party/python/Lib/_pyio.py",
|
||||
"third_party/python/Lib/_sitebuiltins.py",
|
||||
"third_party/python/Lib/_strptime.py",
|
||||
"third_party/python/Lib/_sysconfigdata_m_cosmo_x86_64-cosmo.py",
|
||||
"third_party/python/Lib/_threading_local.py",
|
||||
"third_party/python/Lib/_weakrefset.py",
|
||||
"third_party/python/Lib/abc.py",
|
||||
"third_party/python/Lib/aifc.py",
|
||||
"third_party/python/Lib/antigravity.py",
|
||||
"third_party/python/Lib/argparse.py",
|
||||
"third_party/python/Lib/ast.py",
|
||||
"third_party/python/Lib/asynchat.py",
|
||||
"third_party/python/Lib/asyncio",
|
||||
"third_party/python/Lib/asyncio/__init__.py",
|
||||
"third_party/python/Lib/asyncio/base_events.py",
|
||||
"third_party/python/Lib/asyncio/base_futures.py",
|
||||
"third_party/python/Lib/asyncio/base_subprocess.py",
|
||||
"third_party/python/Lib/asyncio/base_tasks.py",
|
||||
"third_party/python/Lib/asyncio/compat.py",
|
||||
"third_party/python/Lib/asyncio/constants.py",
|
||||
"third_party/python/Lib/asyncio/coroutines.py",
|
||||
"third_party/python/Lib/asyncio/events.py",
|
||||
"third_party/python/Lib/asyncio/futures.py",
|
||||
"third_party/python/Lib/asyncio/locks.py",
|
||||
"third_party/python/Lib/asyncio/log.py",
|
||||
"third_party/python/Lib/asyncio/proactor_events.py",
|
||||
"third_party/python/Lib/asyncio/protocols.py",
|
||||
"third_party/python/Lib/asyncio/queues.py",
|
||||
"third_party/python/Lib/asyncio/selector_events.py",
|
||||
"third_party/python/Lib/asyncio/sslproto.py",
|
||||
"third_party/python/Lib/asyncio/streams.py",
|
||||
"third_party/python/Lib/asyncio/subprocess.py",
|
||||
"third_party/python/Lib/asyncio/tasks.py",
|
||||
"third_party/python/Lib/asyncio/test_utils.py",
|
||||
"third_party/python/Lib/asyncio/transports.py",
|
||||
"third_party/python/Lib/asyncio/unix_events.py",
|
||||
"third_party/python/Lib/asyncio/windows_events.py",
|
||||
"third_party/python/Lib/asyncio/windows_utils.py",
|
||||
"third_party/python/Lib/asyncore.py",
|
||||
"third_party/python/Lib/base64.py",
|
||||
"third_party/python/Lib/bdb.py",
|
||||
"third_party/python/Lib/binhex.py",
|
||||
"third_party/python/Lib/bisect.py",
|
||||
"third_party/python/Lib/bz2.py",
|
||||
"third_party/python/Lib/cProfile.py",
|
||||
"third_party/python/Lib/calendar.py",
|
||||
"third_party/python/Lib/cgi.py",
|
||||
"third_party/python/Lib/cgitb.py",
|
||||
"third_party/python/Lib/chunk.py",
|
||||
"third_party/python/Lib/cmd.py",
|
||||
"third_party/python/Lib/code.py",
|
||||
"third_party/python/Lib/codecs.py",
|
||||
"third_party/python/Lib/codeop.py",
|
||||
"third_party/python/Lib/collections",
|
||||
"third_party/python/Lib/collections/__init__.py",
|
||||
"third_party/python/Lib/collections/abc.py",
|
||||
"third_party/python/Lib/colorsys.py",
|
||||
"third_party/python/Lib/compileall.py",
|
||||
"third_party/python/Lib/configparser.py",
|
||||
"third_party/python/Lib/contextlib.py",
|
||||
"third_party/python/Lib/copy.py",
|
||||
"third_party/python/Lib/copyreg.py",
|
||||
"third_party/python/Lib/crypt.py",
|
||||
"third_party/python/Lib/csv.py",
|
||||
"third_party/python/Lib/datetime.py",
|
||||
"third_party/python/Lib/dbm",
|
||||
"third_party/python/Lib/dbm/__init__.py",
|
||||
"third_party/python/Lib/dbm/dumb.py",
|
||||
"third_party/python/Lib/dbm/gnu.py",
|
||||
"third_party/python/Lib/dbm/ndbm.py",
|
||||
"third_party/python/Lib/decimal.py",
|
||||
"third_party/python/Lib/difflib.py",
|
||||
"third_party/python/Lib/dis.py",
|
||||
"third_party/python/Lib/distutils",
|
||||
"third_party/python/Lib/distutils/__init__.py",
|
||||
"third_party/python/Lib/distutils/_msvccompiler.py",
|
||||
"third_party/python/Lib/distutils/archive_util.py",
|
||||
"third_party/python/Lib/distutils/bcppcompiler.py",
|
||||
"third_party/python/Lib/distutils/ccompiler.py",
|
||||
"third_party/python/Lib/distutils/cmd.py",
|
||||
"third_party/python/Lib/distutils/command",
|
||||
"third_party/python/Lib/distutils/command/__init__.py",
|
||||
"third_party/python/Lib/distutils/command/bdist.py",
|
||||
"third_party/python/Lib/distutils/command/bdist_dumb.py",
|
||||
"third_party/python/Lib/distutils/command/bdist_msi.py",
|
||||
"third_party/python/Lib/distutils/command/bdist_rpm.py",
|
||||
"third_party/python/Lib/distutils/command/bdist_wininst.py",
|
||||
"third_party/python/Lib/distutils/command/build.py",
|
||||
"third_party/python/Lib/distutils/command/build_clib.py",
|
||||
"third_party/python/Lib/distutils/command/build_ext.py",
|
||||
"third_party/python/Lib/distutils/command/build_py.py",
|
||||
"third_party/python/Lib/distutils/command/build_scripts.py",
|
||||
"third_party/python/Lib/distutils/command/check.py",
|
||||
"third_party/python/Lib/distutils/command/clean.py",
|
||||
"third_party/python/Lib/distutils/command/command_template",
|
||||
"third_party/python/Lib/distutils/command/config.py",
|
||||
"third_party/python/Lib/distutils/command/install.py",
|
||||
"third_party/python/Lib/distutils/command/install_data.py",
|
||||
"third_party/python/Lib/distutils/command/install_egg_info.py",
|
||||
"third_party/python/Lib/distutils/command/install_headers.py",
|
||||
"third_party/python/Lib/distutils/command/install_lib.py",
|
||||
"third_party/python/Lib/distutils/command/install_scripts.py",
|
||||
"third_party/python/Lib/distutils/command/register.py",
|
||||
"third_party/python/Lib/distutils/command/sdist.py",
|
||||
"third_party/python/Lib/distutils/command/upload.py",
|
||||
"third_party/python/Lib/distutils/config.py",
|
||||
"third_party/python/Lib/distutils/core.py",
|
||||
"third_party/python/Lib/distutils/cygwinccompiler.py",
|
||||
"third_party/python/Lib/distutils/debug.py",
|
||||
"third_party/python/Lib/distutils/dep_util.py",
|
||||
"third_party/python/Lib/distutils/dir_util.py",
|
||||
"third_party/python/Lib/distutils/dist.py",
|
||||
"third_party/python/Lib/distutils/errors.py",
|
||||
"third_party/python/Lib/distutils/extension.py",
|
||||
"third_party/python/Lib/distutils/fancy_getopt.py",
|
||||
"third_party/python/Lib/distutils/file_util.py",
|
||||
"third_party/python/Lib/distutils/filelist.py",
|
||||
"third_party/python/Lib/distutils/log.py",
|
||||
"third_party/python/Lib/distutils/msvc9compiler.py",
|
||||
"third_party/python/Lib/distutils/msvccompiler.py",
|
||||
"third_party/python/Lib/distutils/spawn.py",
|
||||
"third_party/python/Lib/distutils/sysconfig.py",
|
||||
"third_party/python/Lib/distutils/tests",
|
||||
"third_party/python/Lib/distutils/tests/Setup.sample",
|
||||
"third_party/python/Lib/distutils/tests/__init__.py",
|
||||
"third_party/python/Lib/distutils/tests/support.py",
|
||||
"third_party/python/Lib/distutils/tests/test_archive_util.py",
|
||||
"third_party/python/Lib/distutils/tests/test_bdist.py",
|
||||
"third_party/python/Lib/distutils/tests/test_bdist_dumb.py",
|
||||
"third_party/python/Lib/distutils/tests/test_bdist_msi.py",
|
||||
"third_party/python/Lib/distutils/tests/test_bdist_rpm.py",
|
||||
"third_party/python/Lib/distutils/tests/test_bdist_wininst.py",
|
||||
"third_party/python/Lib/distutils/tests/test_build.py",
|
||||
"third_party/python/Lib/distutils/tests/test_build_clib.py",
|
||||
"third_party/python/Lib/distutils/tests/test_build_ext.py",
|
||||
"third_party/python/Lib/distutils/tests/test_build_py.py",
|
||||
"third_party/python/Lib/distutils/tests/test_build_scripts.py",
|
||||
"third_party/python/Lib/distutils/tests/test_check.py",
|
||||
"third_party/python/Lib/distutils/tests/test_clean.py",
|
||||
"third_party/python/Lib/distutils/tests/test_cmd.py",
|
||||
"third_party/python/Lib/distutils/tests/test_config.py",
|
||||
"third_party/python/Lib/distutils/tests/test_config_cmd.py",
|
||||
"third_party/python/Lib/distutils/tests/test_core.py",
|
||||
"third_party/python/Lib/distutils/tests/test_cygwinccompiler.py",
|
||||
"third_party/python/Lib/distutils/tests/test_dep_util.py",
|
||||
"third_party/python/Lib/distutils/tests/test_dir_util.py",
|
||||
"third_party/python/Lib/distutils/tests/test_dist.py",
|
||||
"third_party/python/Lib/distutils/tests/test_extension.py",
|
||||
"third_party/python/Lib/distutils/tests/test_file_util.py",
|
||||
"third_party/python/Lib/distutils/tests/test_filelist.py",
|
||||
"third_party/python/Lib/distutils/tests/test_install.py",
|
||||
"third_party/python/Lib/distutils/tests/test_install_data.py",
|
||||
"third_party/python/Lib/distutils/tests/test_install_headers.py",
|
||||
"third_party/python/Lib/distutils/tests/test_install_lib.py",
|
||||
"third_party/python/Lib/distutils/tests/test_install_scripts.py",
|
||||
"third_party/python/Lib/distutils/tests/test_log.py",
|
||||
"third_party/python/Lib/distutils/tests/test_msvc9compiler.py",
|
||||
"third_party/python/Lib/distutils/tests/test_msvccompiler.py",
|
||||
"third_party/python/Lib/distutils/tests/test_register.py",
|
||||
"third_party/python/Lib/distutils/tests/test_sdist.py",
|
||||
"third_party/python/Lib/distutils/tests/test_spawn.py",
|
||||
"third_party/python/Lib/distutils/tests/test_sysconfig.py",
|
||||
"third_party/python/Lib/distutils/tests/test_text_file.py",
|
||||
"third_party/python/Lib/distutils/tests/test_unixccompiler.py",
|
||||
"third_party/python/Lib/distutils/tests/test_upload.py",
|
||||
"third_party/python/Lib/distutils/tests/test_util.py",
|
||||
"third_party/python/Lib/distutils/tests/test_version.py",
|
||||
"third_party/python/Lib/distutils/tests/test_versionpredicate.py",
|
||||
"third_party/python/Lib/distutils/text_file.py",
|
||||
"third_party/python/Lib/distutils/unixccompiler.py",
|
||||
"third_party/python/Lib/distutils/util.py",
|
||||
"third_party/python/Lib/distutils/version.py",
|
||||
"third_party/python/Lib/distutils/versionpredicate.py",
|
||||
"third_party/python/Lib/doctest.py",
|
||||
"third_party/python/Lib/dummy_threading.py",
|
||||
"third_party/python/Lib/email",
|
||||
"third_party/python/Lib/email/__init__.py",
|
||||
"third_party/python/Lib/email/_encoded_words.py",
|
||||
"third_party/python/Lib/email/_header_value_parser.py",
|
||||
"third_party/python/Lib/email/_parseaddr.py",
|
||||
"third_party/python/Lib/email/_policybase.py",
|
||||
"third_party/python/Lib/email/architecture.rst",
|
||||
"third_party/python/Lib/email/base64mime.py",
|
||||
"third_party/python/Lib/email/charset.py",
|
||||
"third_party/python/Lib/email/contentmanager.py",
|
||||
"third_party/python/Lib/email/encoders.py",
|
||||
"third_party/python/Lib/email/errors.py",
|
||||
"third_party/python/Lib/email/feedparser.py",
|
||||
"third_party/python/Lib/email/generator.py",
|
||||
"third_party/python/Lib/email/header.py",
|
||||
"third_party/python/Lib/email/headerregistry.py",
|
||||
"third_party/python/Lib/email/iterators.py",
|
||||
"third_party/python/Lib/email/message.py",
|
||||
"third_party/python/Lib/email/mime",
|
||||
"third_party/python/Lib/email/mime/__init__.py",
|
||||
"third_party/python/Lib/email/mime/application.py",
|
||||
"third_party/python/Lib/email/mime/audio.py",
|
||||
"third_party/python/Lib/email/mime/base.py",
|
||||
"third_party/python/Lib/email/mime/image.py",
|
||||
"third_party/python/Lib/email/mime/message.py",
|
||||
"third_party/python/Lib/email/mime/multipart.py",
|
||||
"third_party/python/Lib/email/mime/nonmultipart.py",
|
||||
"third_party/python/Lib/email/mime/text.py",
|
||||
"third_party/python/Lib/email/parser.py",
|
||||
"third_party/python/Lib/email/policy.py",
|
||||
"third_party/python/Lib/email/quoprimime.py",
|
||||
"third_party/python/Lib/email/utils.py",
|
||||
"third_party/python/Lib/encodings",
|
||||
"third_party/python/Lib/encodings/__init__.py",
|
||||
"third_party/python/Lib/encodings/aliases.py",
|
||||
"third_party/python/Lib/encodings/ascii.py",
|
||||
"third_party/python/Lib/encodings/base64_codec.py",
|
||||
"third_party/python/Lib/encodings/big5.py",
|
||||
"third_party/python/Lib/encodings/big5hkscs.py",
|
||||
"third_party/python/Lib/encodings/bz2_codec.py",
|
||||
"third_party/python/Lib/encodings/charmap.py",
|
||||
"third_party/python/Lib/encodings/cp037.py",
|
||||
"third_party/python/Lib/encodings/cp1006.py",
|
||||
"third_party/python/Lib/encodings/cp1026.py",
|
||||
"third_party/python/Lib/encodings/cp1125.py",
|
||||
"third_party/python/Lib/encodings/cp1140.py",
|
||||
"third_party/python/Lib/encodings/cp1250.py",
|
||||
"third_party/python/Lib/encodings/cp1251.py",
|
||||
"third_party/python/Lib/encodings/cp1252.py",
|
||||
"third_party/python/Lib/encodings/cp1253.py",
|
||||
"third_party/python/Lib/encodings/cp1254.py",
|
||||
"third_party/python/Lib/encodings/cp1255.py",
|
||||
"third_party/python/Lib/encodings/cp1256.py",
|
||||
"third_party/python/Lib/encodings/cp1257.py",
|
||||
"third_party/python/Lib/encodings/cp1258.py",
|
||||
"third_party/python/Lib/encodings/cp273.py",
|
||||
"third_party/python/Lib/encodings/cp424.py",
|
||||
"third_party/python/Lib/encodings/cp437.py",
|
||||
"third_party/python/Lib/encodings/cp500.py",
|
||||
"third_party/python/Lib/encodings/cp65001.py",
|
||||
"third_party/python/Lib/encodings/cp720.py",
|
||||
"third_party/python/Lib/encodings/cp737.py",
|
||||
"third_party/python/Lib/encodings/cp775.py",
|
||||
"third_party/python/Lib/encodings/cp850.py",
|
||||
"third_party/python/Lib/encodings/cp852.py",
|
||||
"third_party/python/Lib/encodings/cp855.py",
|
||||
"third_party/python/Lib/encodings/cp856.py",
|
||||
"third_party/python/Lib/encodings/cp857.py",
|
||||
"third_party/python/Lib/encodings/cp858.py",
|
||||
"third_party/python/Lib/encodings/cp860.py",
|
||||
"third_party/python/Lib/encodings/cp861.py",
|
||||
"third_party/python/Lib/encodings/cp862.py",
|
||||
"third_party/python/Lib/encodings/cp863.py",
|
||||
"third_party/python/Lib/encodings/cp864.py",
|
||||
"third_party/python/Lib/encodings/cp865.py",
|
||||
"third_party/python/Lib/encodings/cp866.py",
|
||||
"third_party/python/Lib/encodings/cp869.py",
|
||||
"third_party/python/Lib/encodings/cp874.py",
|
||||
"third_party/python/Lib/encodings/cp875.py",
|
||||
"third_party/python/Lib/encodings/cp932.py",
|
||||
"third_party/python/Lib/encodings/cp949.py",
|
||||
"third_party/python/Lib/encodings/cp950.py",
|
||||
"third_party/python/Lib/encodings/euc_jis_2004.py",
|
||||
"third_party/python/Lib/encodings/euc_jisx0213.py",
|
||||
"third_party/python/Lib/encodings/euc_jp.py",
|
||||
"third_party/python/Lib/encodings/euc_kr.py",
|
||||
"third_party/python/Lib/encodings/gb18030.py",
|
||||
"third_party/python/Lib/encodings/gb2312.py",
|
||||
"third_party/python/Lib/encodings/gbk.py",
|
||||
"third_party/python/Lib/encodings/hex_codec.py",
|
||||
"third_party/python/Lib/encodings/hp_roman8.py",
|
||||
"third_party/python/Lib/encodings/hz.py",
|
||||
"third_party/python/Lib/encodings/idna.py",
|
||||
"third_party/python/Lib/encodings/iso2022_jp.py",
|
||||
"third_party/python/Lib/encodings/iso2022_jp_1.py",
|
||||
"third_party/python/Lib/encodings/iso2022_jp_2.py",
|
||||
"third_party/python/Lib/encodings/iso2022_jp_2004.py",
|
||||
"third_party/python/Lib/encodings/iso2022_jp_3.py",
|
||||
"third_party/python/Lib/encodings/iso2022_jp_ext.py",
|
||||
"third_party/python/Lib/encodings/iso2022_kr.py",
|
||||
"third_party/python/Lib/encodings/iso8859_1.py",
|
||||
"third_party/python/Lib/encodings/iso8859_10.py",
|
||||
"third_party/python/Lib/encodings/iso8859_11.py",
|
||||
"third_party/python/Lib/encodings/iso8859_13.py",
|
||||
"third_party/python/Lib/encodings/iso8859_14.py",
|
||||
"third_party/python/Lib/encodings/iso8859_15.py",
|
||||
"third_party/python/Lib/encodings/iso8859_16.py",
|
||||
"third_party/python/Lib/encodings/iso8859_2.py",
|
||||
"third_party/python/Lib/encodings/iso8859_3.py",
|
||||
"third_party/python/Lib/encodings/iso8859_4.py",
|
||||
"third_party/python/Lib/encodings/iso8859_5.py",
|
||||
"third_party/python/Lib/encodings/iso8859_6.py",
|
||||
"third_party/python/Lib/encodings/iso8859_7.py",
|
||||
"third_party/python/Lib/encodings/iso8859_8.py",
|
||||
"third_party/python/Lib/encodings/iso8859_9.py",
|
||||
"third_party/python/Lib/encodings/johab.py",
|
||||
"third_party/python/Lib/encodings/koi8_r.py",
|
||||
"third_party/python/Lib/encodings/koi8_t.py",
|
||||
"third_party/python/Lib/encodings/koi8_u.py",
|
||||
"third_party/python/Lib/encodings/kz1048.py",
|
||||
"third_party/python/Lib/encodings/latin_1.py",
|
||||
"third_party/python/Lib/encodings/mac_arabic.py",
|
||||
"third_party/python/Lib/encodings/mac_centeuro.py",
|
||||
"third_party/python/Lib/encodings/mac_croatian.py",
|
||||
"third_party/python/Lib/encodings/mac_cyrillic.py",
|
||||
"third_party/python/Lib/encodings/mac_farsi.py",
|
||||
"third_party/python/Lib/encodings/mac_greek.py",
|
||||
"third_party/python/Lib/encodings/mac_iceland.py",
|
||||
"third_party/python/Lib/encodings/mac_latin2.py",
|
||||
"third_party/python/Lib/encodings/mac_roman.py",
|
||||
"third_party/python/Lib/encodings/mac_romanian.py",
|
||||
"third_party/python/Lib/encodings/mac_turkish.py",
|
||||
"third_party/python/Lib/encodings/mbcs.py",
|
||||
"third_party/python/Lib/encodings/oem.py",
|
||||
"third_party/python/Lib/encodings/palmos.py",
|
||||
"third_party/python/Lib/encodings/ptcp154.py",
|
||||
"third_party/python/Lib/encodings/punycode.py",
|
||||
"third_party/python/Lib/encodings/quopri_codec.py",
|
||||
"third_party/python/Lib/encodings/raw_unicode_escape.py",
|
||||
"third_party/python/Lib/encodings/rot_13.py",
|
||||
"third_party/python/Lib/encodings/shift_jis.py",
|
||||
"third_party/python/Lib/encodings/shift_jis_2004.py",
|
||||
"third_party/python/Lib/encodings/shift_jisx0213.py",
|
||||
"third_party/python/Lib/encodings/tis_620.py",
|
||||
"third_party/python/Lib/encodings/undefined.py",
|
||||
"third_party/python/Lib/encodings/unicode_escape.py",
|
||||
"third_party/python/Lib/encodings/unicode_internal.py",
|
||||
"third_party/python/Lib/encodings/utf_16.py",
|
||||
"third_party/python/Lib/encodings/utf_16_be.py",
|
||||
"third_party/python/Lib/encodings/utf_16_le.py",
|
||||
"third_party/python/Lib/encodings/utf_32.py",
|
||||
"third_party/python/Lib/encodings/utf_32_be.py",
|
||||
"third_party/python/Lib/encodings/utf_32_le.py",
|
||||
"third_party/python/Lib/encodings/utf_7.py",
|
||||
"third_party/python/Lib/encodings/utf_8.py",
|
||||
"third_party/python/Lib/encodings/utf_8_sig.py",
|
||||
"third_party/python/Lib/encodings/uu_codec.py",
|
||||
"third_party/python/Lib/encodings/zlib_codec.py",
|
||||
"third_party/python/Lib/ensurepip",
|
||||
"third_party/python/Lib/ensurepip/__init__.py",
|
||||
"third_party/python/Lib/ensurepip/__main__.py",
|
||||
"third_party/python/Lib/ensurepip/_bundled",
|
||||
"third_party/python/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl",
|
||||
"third_party/python/Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl",
|
||||
"third_party/python/Lib/ensurepip/_uninstall.py",
|
||||
"third_party/python/Lib/enum.py",
|
||||
"third_party/python/Lib/filecmp.py",
|
||||
"third_party/python/Lib/fileinput.py",
|
||||
"third_party/python/Lib/fnmatch.py",
|
||||
"third_party/python/Lib/formatter.py",
|
||||
"third_party/python/Lib/fractions.py",
|
||||
"third_party/python/Lib/ftplib.py",
|
||||
"third_party/python/Lib/functools.py",
|
||||
"third_party/python/Lib/genericpath.py",
|
||||
"third_party/python/Lib/getopt.py",
|
||||
"third_party/python/Lib/getpass.py",
|
||||
"third_party/python/Lib/gettext.py",
|
||||
"third_party/python/Lib/glob.py",
|
||||
"third_party/python/Lib/gzip.py",
|
||||
"third_party/python/Lib/hashlib.py",
|
||||
"third_party/python/Lib/heapq.py",
|
||||
"third_party/python/Lib/hmac.py",
|
||||
"third_party/python/Lib/html",
|
||||
"third_party/python/Lib/html/__init__.py",
|
||||
"third_party/python/Lib/html/entities.py",
|
||||
"third_party/python/Lib/html/parser.py",
|
||||
"third_party/python/Lib/http",
|
||||
"third_party/python/Lib/http/__init__.py",
|
||||
"third_party/python/Lib/http/client.py",
|
||||
"third_party/python/Lib/http/cookiejar.py",
|
||||
"third_party/python/Lib/http/cookies.py",
|
||||
"third_party/python/Lib/http/server.py",
|
||||
"third_party/python/Lib/imaplib.py",
|
||||
"third_party/python/Lib/imghdr.py",
|
||||
"third_party/python/Lib/imp.py",
|
||||
"third_party/python/Lib/importlib",
|
||||
"third_party/python/Lib/importlib/__init__.py",
|
||||
"third_party/python/Lib/importlib/_bootstrap.py",
|
||||
"third_party/python/Lib/importlib/_bootstrap_external.py",
|
||||
"third_party/python/Lib/importlib/abc.py",
|
||||
"third_party/python/Lib/importlib/machinery.py",
|
||||
"third_party/python/Lib/importlib/util.py",
|
||||
"third_party/python/Lib/inspect.py",
|
||||
"third_party/python/Lib/io.py",
|
||||
"third_party/python/Lib/ipaddress.py",
|
||||
"third_party/python/Lib/json",
|
||||
"third_party/python/Lib/json/__init__.py",
|
||||
"third_party/python/Lib/json/decoder.py",
|
||||
"third_party/python/Lib/json/encoder.py",
|
||||
"third_party/python/Lib/json/scanner.py",
|
||||
"third_party/python/Lib/json/tool.py",
|
||||
"third_party/python/Lib/keyword.py",
|
||||
"third_party/python/Lib/linecache.py",
|
||||
"third_party/python/Lib/locale.py",
|
||||
"third_party/python/Lib/logging",
|
||||
"third_party/python/Lib/logging/__init__.py",
|
||||
"third_party/python/Lib/logging/config.py",
|
||||
"third_party/python/Lib/logging/handlers.py",
|
||||
"third_party/python/Lib/lzma.py",
|
||||
"third_party/python/Lib/macpath.py",
|
||||
"third_party/python/Lib/macurl2path.py",
|
||||
"third_party/python/Lib/mailbox.py",
|
||||
"third_party/python/Lib/mailcap.py",
|
||||
"third_party/python/Lib/mimetypes.py",
|
||||
"third_party/python/Lib/modulefinder.py",
|
||||
"third_party/python/Lib/msilib",
|
||||
"third_party/python/Lib/msilib/__init__.py",
|
||||
"third_party/python/Lib/msilib/schema.py",
|
||||
"third_party/python/Lib/msilib/sequence.py",
|
||||
"third_party/python/Lib/msilib/text.py",
|
||||
"third_party/python/Lib/multiprocessing",
|
||||
"third_party/python/Lib/multiprocessing/__init__.py",
|
||||
"third_party/python/Lib/multiprocessing/connection.py",
|
||||
"third_party/python/Lib/multiprocessing/context.py",
|
||||
"third_party/python/Lib/multiprocessing/dummy",
|
||||
"third_party/python/Lib/multiprocessing/dummy/__init__.py",
|
||||
"third_party/python/Lib/multiprocessing/dummy/connection.py",
|
||||
"third_party/python/Lib/multiprocessing/forkserver.py",
|
||||
"third_party/python/Lib/multiprocessing/heap.py",
|
||||
"third_party/python/Lib/multiprocessing/managers.py",
|
||||
"third_party/python/Lib/multiprocessing/pool.py",
|
||||
"third_party/python/Lib/multiprocessing/popen_fork.py",
|
||||
"third_party/python/Lib/multiprocessing/popen_forkserver.py",
|
||||
"third_party/python/Lib/multiprocessing/popen_spawn_posix.py",
|
||||
"third_party/python/Lib/multiprocessing/popen_spawn_win32.py",
|
||||
"third_party/python/Lib/multiprocessing/process.py",
|
||||
"third_party/python/Lib/multiprocessing/queues.py",
|
||||
"third_party/python/Lib/multiprocessing/reduction.py",
|
||||
"third_party/python/Lib/multiprocessing/resource_sharer.py",
|
||||
"third_party/python/Lib/multiprocessing/semaphore_tracker.py",
|
||||
"third_party/python/Lib/multiprocessing/sharedctypes.py",
|
||||
"third_party/python/Lib/multiprocessing/spawn.py",
|
||||
"third_party/python/Lib/multiprocessing/synchronize.py",
|
||||
"third_party/python/Lib/multiprocessing/util.py",
|
||||
"third_party/python/Lib/netrc.py",
|
||||
"third_party/python/Lib/nntplib.py",
|
||||
"third_party/python/Lib/ntpath.py",
|
||||
"third_party/python/Lib/nturl2path.py",
|
||||
"third_party/python/Lib/numbers.py",
|
||||
"third_party/python/Lib/opcode.py",
|
||||
"third_party/python/Lib/operator.py",
|
||||
"third_party/python/Lib/optparse.py",
|
||||
"third_party/python/Lib/os.py",
|
||||
"third_party/python/Lib/pathlib.py",
|
||||
"third_party/python/Lib/pdb.py",
|
||||
"third_party/python/Lib/pickle.py",
|
||||
"third_party/python/Lib/pickletools.py",
|
||||
"third_party/python/Lib/pipes.py",
|
||||
"third_party/python/Lib/pkgutil.py",
|
||||
"third_party/python/Lib/platform.py",
|
||||
"third_party/python/Lib/plistlib.py",
|
||||
"third_party/python/Lib/poplib.py",
|
||||
"third_party/python/Lib/posixpath.py",
|
||||
"third_party/python/Lib/pprint.py",
|
||||
"third_party/python/Lib/profile.py",
|
||||
"third_party/python/Lib/pstats.py",
|
||||
"third_party/python/Lib/pty.py",
|
||||
"third_party/python/Lib/py_compile.py",
|
||||
"third_party/python/Lib/pyclbr.py",
|
||||
"third_party/python/Lib/pydoc.py",
|
||||
"third_party/python/Lib/queue.py",
|
||||
"third_party/python/Lib/quopri.py",
|
||||
"third_party/python/Lib/random.py",
|
||||
"third_party/python/Lib/re.py",
|
||||
"third_party/python/Lib/reprlib.py",
|
||||
"third_party/python/Lib/rlcompleter.py",
|
||||
"third_party/python/Lib/runpy.py",
|
||||
"third_party/python/Lib/sched.py",
|
||||
"third_party/python/Lib/secrets.py",
|
||||
"third_party/python/Lib/selectors.py",
|
||||
"third_party/python/Lib/shelve.py",
|
||||
"third_party/python/Lib/shlex.py",
|
||||
"third_party/python/Lib/shutil.py",
|
||||
"third_party/python/Lib/signal.py",
|
||||
"third_party/python/Lib/site.py",
|
||||
"third_party/python/Lib/smtpd.py",
|
||||
"third_party/python/Lib/smtplib.py",
|
||||
"third_party/python/Lib/sndhdr.py",
|
||||
"third_party/python/Lib/socket.py",
|
||||
"third_party/python/Lib/socketserver.py",
|
||||
"third_party/python/Lib/sqlite3",
|
||||
"third_party/python/Lib/sqlite3/__init__.py",
|
||||
"third_party/python/Lib/sqlite3/dbapi2.py",
|
||||
"third_party/python/Lib/sqlite3/dump.py",
|
||||
"third_party/python/Lib/sre_compile.py",
|
||||
"third_party/python/Lib/sre_constants.py",
|
||||
"third_party/python/Lib/sre_parse.py",
|
||||
"third_party/python/Lib/ssl.py",
|
||||
"third_party/python/Lib/stat.py",
|
||||
"third_party/python/Lib/statistics.py",
|
||||
"third_party/python/Lib/string.py",
|
||||
"third_party/python/Lib/stringprep.py",
|
||||
"third_party/python/Lib/struct.py",
|
||||
"third_party/python/Lib/subprocess.py",
|
||||
"third_party/python/Lib/sunau.py",
|
||||
"third_party/python/Lib/symbol.py",
|
||||
"third_party/python/Lib/symtable.py",
|
||||
"third_party/python/Lib/sysconfig.py",
|
||||
"third_party/python/Lib/tabnanny.py",
|
||||
"third_party/python/Lib/tarfile.py",
|
||||
"third_party/python/Lib/telnetlib.py",
|
||||
"third_party/python/Lib/tempfile.py",
|
||||
"third_party/python/Lib/textwrap.py",
|
||||
"third_party/python/Lib/this.py",
|
||||
"third_party/python/Lib/threading.py",
|
||||
"third_party/python/Lib/timeit.py",
|
||||
"third_party/python/Lib/token.py",
|
||||
"third_party/python/Lib/tokenize.py",
|
||||
"third_party/python/Lib/trace.py",
|
||||
"third_party/python/Lib/traceback.py",
|
||||
"third_party/python/Lib/tracemalloc.py",
|
||||
"third_party/python/Lib/tty.py",
|
||||
"third_party/python/Lib/types.py",
|
||||
"third_party/python/Lib/typing.py",
|
||||
"third_party/python/Lib/unittest",
|
||||
"third_party/python/Lib/unittest/__init__.py",
|
||||
"third_party/python/Lib/unittest/__main__.py",
|
||||
"third_party/python/Lib/unittest/case.py",
|
||||
"third_party/python/Lib/unittest/loader.py",
|
||||
"third_party/python/Lib/unittest/main.py",
|
||||
"third_party/python/Lib/unittest/mock.py",
|
||||
"third_party/python/Lib/unittest/result.py",
|
||||
"third_party/python/Lib/unittest/runner.py",
|
||||
"third_party/python/Lib/unittest/signals.py",
|
||||
"third_party/python/Lib/unittest/suite.py",
|
||||
"third_party/python/Lib/unittest/util.py",
|
||||
"third_party/python/Lib/urllib",
|
||||
"third_party/python/Lib/urllib/__init__.py",
|
||||
"third_party/python/Lib/urllib/error.py",
|
||||
"third_party/python/Lib/urllib/parse.py",
|
||||
"third_party/python/Lib/urllib/request.py",
|
||||
"third_party/python/Lib/urllib/response.py",
|
||||
"third_party/python/Lib/urllib/robotparser.py",
|
||||
"third_party/python/Lib/uu.py",
|
||||
"third_party/python/Lib/uuid.py",
|
||||
"third_party/python/Lib/venv",
|
||||
"third_party/python/Lib/venv/__init__.py",
|
||||
"third_party/python/Lib/venv/__main__.py",
|
||||
"third_party/python/Lib/venv/scripts/common",
|
||||
"third_party/python/Lib/venv/scripts/common/activate",
|
||||
"third_party/python/Lib/venv/scripts/nt",
|
||||
"third_party/python/Lib/venv/scripts/nt/Activate.ps1",
|
||||
"third_party/python/Lib/venv/scripts/nt/activate.bat",
|
||||
"third_party/python/Lib/venv/scripts/nt/deactivate.bat",
|
||||
"third_party/python/Lib/venv/scripts/posix",
|
||||
"third_party/python/Lib/venv/scripts/posix/activate.csh",
|
||||
"third_party/python/Lib/venv/scripts/posix/activate.fish",
|
||||
"third_party/python/Lib/warnings.py",
|
||||
"third_party/python/Lib/wave.py",
|
||||
"third_party/python/Lib/weakref.py",
|
||||
"third_party/python/Lib/webbrowser.py",
|
||||
"third_party/python/Lib/wsgiref",
|
||||
"third_party/python/Lib/wsgiref/__init__.py",
|
||||
"third_party/python/Lib/wsgiref/handlers.py",
|
||||
"third_party/python/Lib/wsgiref/headers.py",
|
||||
"third_party/python/Lib/wsgiref/simple_server.py",
|
||||
"third_party/python/Lib/wsgiref/util.py",
|
||||
"third_party/python/Lib/wsgiref/validate.py",
|
||||
"third_party/python/Lib/xdrlib.py",
|
||||
"third_party/python/Lib/xml",
|
||||
"third_party/python/Lib/xml/__init__.py",
|
||||
"third_party/python/Lib/xml/dom",
|
||||
"third_party/python/Lib/xml/dom/NodeFilter.py",
|
||||
"third_party/python/Lib/xml/dom/__init__.py",
|
||||
"third_party/python/Lib/xml/dom/domreg.py",
|
||||
"third_party/python/Lib/xml/dom/expatbuilder.py",
|
||||
"third_party/python/Lib/xml/dom/minicompat.py",
|
||||
"third_party/python/Lib/xml/dom/minidom.py",
|
||||
"third_party/python/Lib/xml/dom/pulldom.py",
|
||||
"third_party/python/Lib/xml/dom/xmlbuilder.py",
|
||||
"third_party/python/Lib/xml/etree",
|
||||
"third_party/python/Lib/xml/etree/ElementInclude.py",
|
||||
"third_party/python/Lib/xml/etree/ElementPath.py",
|
||||
"third_party/python/Lib/xml/etree/ElementTree.py",
|
||||
"third_party/python/Lib/xml/etree/__init__.py",
|
||||
"third_party/python/Lib/xml/etree/cElementTree.py",
|
||||
"third_party/python/Lib/xml/parsers",
|
||||
"third_party/python/Lib/xml/parsers/__init__.py",
|
||||
"third_party/python/Lib/xml/parsers/expat.py",
|
||||
"third_party/python/Lib/xml/sax",
|
||||
"third_party/python/Lib/xml/sax/__init__.py",
|
||||
"third_party/python/Lib/xml/sax/_exceptions.py",
|
||||
"third_party/python/Lib/xml/sax/expatreader.py",
|
||||
"third_party/python/Lib/xml/sax/handler.py",
|
||||
"third_party/python/Lib/xml/sax/saxutils.py",
|
||||
"third_party/python/Lib/xml/sax/xmlreader.py",
|
||||
"third_party/python/Lib/xmlrpc",
|
||||
"third_party/python/Lib/xmlrpc/__init__.py",
|
||||
"third_party/python/Lib/xmlrpc/client.py",
|
||||
"third_party/python/Lib/xmlrpc/server.py",
|
||||
"third_party/python/Lib/zipapp.py",
|
||||
"third_party/python/Lib/zipfile.py",
|
||||
)
|
||||
|
||||
ARTIFACTS = set()
|
||||
|
||||
def MakeDirs(d):
|
||||
if d + "/" not in ARTIFACTS:
|
||||
if os.path.basename(d) != '__pycache__':
|
||||
return
|
||||
ARTIFACTS.add(d + "/")
|
||||
if d == "third_party/python/Lib":
|
||||
print()
|
||||
print("o/$(MODE)/third_party/python/Lib/:\n"
|
||||
"\t@mkdir -p $@")
|
||||
print()
|
||||
print("o/$(MODE)/third_party/python/Lib/.zip.o:\t\\\n"
|
||||
"\t\to/$(MODE)/third_party/python/Lib/\n"
|
||||
"\t@$(COMPILE) -AZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) $(OUTPUT_OPTION) $<")
|
||||
else:
|
||||
p = os.path.dirname(d)
|
||||
MakeDirs(p)
|
||||
print()
|
||||
print(("o/$(MODE)/%s/:\t\\\n"
|
||||
"\t\to/$(MODE)/%s/\n"
|
||||
"\t@mkdir -p $@") % (d, p))
|
||||
print()
|
||||
print(("o/$(MODE)/%s/.zip.o:\t\\\n"
|
||||
"\t\to/$(MODE)/%s/\n"
|
||||
"\t@$(COMPILE) -AZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) $(OUTPUT_OPTION) $<") % (d, d))
|
||||
|
||||
for f in SAUCES:
|
||||
if f.endswith(".py"):
|
||||
d = "%s/__pycache__" % (os.path.dirname(f))
|
||||
MakeDirs(d)
|
||||
b = os.path.basename(f)
|
||||
c = "%s/%s.cpython-36.pyc" % (d, b[:-3])
|
||||
print()
|
||||
print(("o/$(MODE)/%s:\t\\\n"
|
||||
"\t\t%s\t\\\n"
|
||||
"\t\to/$(MODE)/%s/\t\\\n"
|
||||
"\t\t%s\n"
|
||||
"\t@$(COMPILE) -APYCOMP %s -o $@ $<") % (c, f, d, PYCOMP, PYCOMP))
|
||||
print()
|
||||
print(("o/$(MODE)/%s.zip.o:\t\\\n"
|
||||
"\t\to/$(MODE)/%s\n"
|
||||
"\t@$(COMPILE) -AZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) $(OUTPUT_OPTION) $<") % (c, c))
|
||||
ARTIFACTS.add(c)
|
||||
elif os.path.basename(f) == '__pycache__':
|
||||
MakeDirs(f)
|
||||
ARTIFACTS.add(f + "/")
|
||||
|
||||
print()
|
||||
print("THIRD_PARTY_PYTHON_STDLIB_PYC_OBJS =\t\\")
|
||||
print("\t" + "\t\\\n\t".join(sorted("o/$(MODE)/%s.zip.o" % (x) for x in ARTIFACTS)))
|
189
third_party/python/pycomp.c
vendored
Normal file
189
third_party/python/pycomp.c
vendored
Normal file
|
@ -0,0 +1,189 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2021 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
│ above copyright notice and this permission notice appear in all copies. │
|
||||
│ │
|
||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/python/Include/bytesobject.h"
|
||||
#include "third_party/python/Include/compile.h"
|
||||
#include "third_party/python/Include/fileutils.h"
|
||||
#include "third_party/python/Include/import.h"
|
||||
#include "third_party/python/Include/marshal.h"
|
||||
#include "third_party/python/Include/pydebug.h"
|
||||
#include "third_party/python/Include/pylifecycle.h"
|
||||
#include "third_party/python/Include/pymacro.h"
|
||||
#include "third_party/python/Include/pythonrun.h"
|
||||
/* clang-format off */
|
||||
|
||||
#define MANUAL "\
|
||||
SYNOPSIS\n\
|
||||
\n\
|
||||
pycomp.com [FLAGS] SOURCE\n\
|
||||
\n\
|
||||
OVERVIEW\n\
|
||||
\n\
|
||||
Python Compiler\n\
|
||||
\n\
|
||||
FLAGS\n\
|
||||
\n\
|
||||
-o PATH specified output pyc file\n\
|
||||
-n do nothing\n\
|
||||
-O optimize\n\
|
||||
-h help\n\
|
||||
\n\
|
||||
EXAMPLE\n\
|
||||
\n\
|
||||
pycomp.com -o foo/__pycache__/__init__.cpython-3.6.pyc foo/__init__.py\n\
|
||||
\n"
|
||||
|
||||
PyObject *PyMarshal_Init(void);
|
||||
PyObject *PyInit_gc(void);
|
||||
PyObject *PyInit__ast(void);
|
||||
PyObject *_PyWarnings_Init(void);
|
||||
PyObject *PyInit__string(void);
|
||||
|
||||
struct _inittab _PyImport_Inittab[] = {
|
||||
{"marshal", PyMarshal_Init},
|
||||
{"_imp", PyInit_imp},
|
||||
{"_ast", PyInit__ast},
|
||||
{"builtins"},
|
||||
{"sys"},
|
||||
{"gc", PyInit_gc},
|
||||
{"_warnings", _PyWarnings_Init},
|
||||
{"_string", PyInit__string},
|
||||
{0}
|
||||
};
|
||||
|
||||
const struct _frozen *PyImport_FrozenModules;
|
||||
const struct _frozen _PyImport_FrozenModules[] = {{0}};
|
||||
struct _inittab *PyImport_Inittab = _PyImport_Inittab;
|
||||
|
||||
char *inpath;
|
||||
char *outpath;
|
||||
bool optimize;
|
||||
|
||||
char *
|
||||
StripComponents(const char *path, int n)
|
||||
{
|
||||
const char *p;
|
||||
while (n-- > 0) {
|
||||
for (p = path; *p; ++p) {
|
||||
if (*p == '/') {
|
||||
path = p + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (char *)path;
|
||||
}
|
||||
|
||||
void
|
||||
GetOpts(int argc, char *argv[])
|
||||
{
|
||||
int opt;
|
||||
char *outdir;
|
||||
while ((opt = getopt(argc, argv, "hnOo:")) != -1) {
|
||||
switch (opt) {
|
||||
case 'O':
|
||||
optimize = true;
|
||||
break;
|
||||
case 'o':
|
||||
outpath = optarg;
|
||||
break;
|
||||
case 'n':
|
||||
exit(0);
|
||||
case 'h':
|
||||
fputs(MANUAL, stdout);
|
||||
exit(0);
|
||||
default:
|
||||
fputs(MANUAL, stderr);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if (argc - optind != 1) {
|
||||
fputs("error: need one input file\n", stderr);
|
||||
exit(1);
|
||||
}
|
||||
inpath = argv[optind];
|
||||
if (!outpath) {
|
||||
outdir = gc(xasprintf("%s/__pycache__", gc(xdirname(inpath))));
|
||||
mkdir(outdir, 0755);
|
||||
outpath = xasprintf("%s/%s.cpython-36.pyc", outdir,
|
||||
gc(xstripexts(basename(inpath))));
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int fd;
|
||||
char *name;
|
||||
ssize_t rc;
|
||||
size_t i, n;
|
||||
struct stat st;
|
||||
char *s, *p, m[12];
|
||||
PyObject *code, *marshalled;
|
||||
GetOpts(argc, argv);
|
||||
marshalled = 0;
|
||||
if (stat(inpath, &st) == -1) perror(inpath), exit(1);
|
||||
CHECK_NOTNULL((p = gc(xslurp(inpath, &n))));
|
||||
PyImport_FrozenModules = _PyImport_FrozenModules;
|
||||
Py_NoUserSiteDirectory++;
|
||||
Py_NoSiteFlag++;
|
||||
Py_IgnoreEnvironmentFlag++;
|
||||
Py_FrozenFlag++;
|
||||
Py_SetProgramName(gc(utf8toutf32(argv[0], -1, 0)));
|
||||
_Py_InitializeEx_Private(1, 0);
|
||||
name = gc(xjoinpaths(".python", StripComponents(inpath, 3)));
|
||||
code = Py_CompileStringExFlags(p, name, Py_file_input, NULL, optimize);
|
||||
if (!code) goto error;
|
||||
marshalled = PyMarshal_WriteObjectToString(code, Py_MARSHAL_VERSION);
|
||||
Py_CLEAR(code);
|
||||
if (!marshalled) goto error;
|
||||
assert(PyBytes_CheckExact(marshalled));
|
||||
p = PyBytes_AS_STRING(marshalled);
|
||||
n = PyBytes_GET_SIZE(marshalled);
|
||||
CHECK_NE(-1, (fd = open(outpath, O_CREAT|O_TRUNC|O_WRONLY, 0644)));
|
||||
WRITE16LE(m+0, 3379); /* Python 3.6rc1 */
|
||||
WRITE16LE(m+2, READ16LE("\r\n"));
|
||||
WRITE32LE(m+4, st.st_mtim.tv_sec); /* tsk tsk y2038 */
|
||||
WRITE32LE(m+8, n);
|
||||
CHECK_EQ(sizeof(m), write(fd, m, sizeof(m)));
|
||||
for (i = 0; i < n; i += rc) {
|
||||
CHECK_NE(-1, (rc = write(fd, p + i, n - i)));
|
||||
}
|
||||
CHECK_NE(-1, close(fd));
|
||||
Py_CLEAR(marshalled);
|
||||
Py_Finalize();
|
||||
return 0;
|
||||
error:
|
||||
PyErr_Print();
|
||||
Py_Finalize();
|
||||
if (marshalled) Py_DECREF(marshalled);
|
||||
return 1;
|
||||
}
|
3
third_party/python/pyconfig.h
vendored
3
third_party/python/pyconfig.h
vendored
|
@ -1,5 +1,6 @@
|
|||
#ifndef Py_PYCONFIG_H
|
||||
#define Py_PYCONFIG_H
|
||||
#include "libc/dce.h"
|
||||
#include "third_party/zlib/zlib.h"
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
|
@ -1360,7 +1361,9 @@
|
|||
/* #undef WITH_NEXT_FRAMEWORK */
|
||||
|
||||
/* Define if you want to compile in Python-specific mallocs */
|
||||
#ifndef __FSANITIZE_ADDRESS__
|
||||
#define WITH_PYMALLOC 1
|
||||
#endif
|
||||
|
||||
/* Define if you want to compile in rudimentary thread support */
|
||||
/* #undef WITH_THREAD */
|
||||
|
|
54
third_party/python/pydump.py
vendored
Normal file
54
third_party/python/pydump.py
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
# read a .pyc file and pretty-print it
|
||||
# copied from https://gist.github.com/twerp/fdc9975f0461821fcd3d7679d1f0f7e9
|
||||
# copied from http://nedbatchelder.com/blog/200804/the_structure_of_pyc_files.html
|
||||
# and updated to Python 3.5 (Nov 10th 2015)
|
||||
|
||||
import dis, marshal, struct, sys, time, types, binascii
|
||||
|
||||
def show_file(fname):
|
||||
f = open(fname, "rb")
|
||||
magic = f.read(4)
|
||||
moddate = f.read(4)
|
||||
filesz = f.read(4)
|
||||
modtime = time.asctime(time.localtime(struct.unpack('=L', moddate)[0]))
|
||||
filesz = struct.unpack('=L', filesz)
|
||||
print("magic %s" % (binascii.hexlify(magic)))
|
||||
print("moddate %s (%s)" % (binascii.hexlify(moddate), modtime))
|
||||
print("files sz %d" % filesz)
|
||||
code = marshal.load(f)
|
||||
show_code(code)
|
||||
|
||||
def show_code(code, indent=''):
|
||||
print("%scode" % indent)
|
||||
indent += ' '
|
||||
print("%sargcount %d" % (indent, code.co_argcount))
|
||||
print("%snlocals %d" % (indent, code.co_nlocals))
|
||||
print("%sstacksize %d" % (indent, code.co_stacksize))
|
||||
print("%sflags %04x" % (indent, code.co_flags))
|
||||
show_hex("code", code.co_code, indent=indent)
|
||||
dis.disassemble(code)
|
||||
print("%sconsts" % indent)
|
||||
for const in code.co_consts:
|
||||
if type(const) == types.CodeType:
|
||||
show_code(const, indent+' ')
|
||||
else:
|
||||
print(" %s%r" % (indent, const))
|
||||
print("%snames %r" % (indent, code.co_names))
|
||||
print("%svarnames %r" % (indent, code.co_varnames))
|
||||
print("%sfreevars %r" % (indent, code.co_freevars))
|
||||
print("%scellvars %r" % (indent, code.co_cellvars))
|
||||
print("%sfilename %r" % (indent, code.co_filename))
|
||||
print("%sname %r" % (indent, code.co_name))
|
||||
print("%sfirstlineno %d" % (indent, code.co_firstlineno))
|
||||
show_hex("lnotab", code.co_lnotab, indent=indent)
|
||||
|
||||
def show_hex(label, h, indent):
|
||||
h = binascii.hexlify(h)
|
||||
if len(h) < 60:
|
||||
print("%s%s %s" % (indent, label, h))
|
||||
else:
|
||||
print("%s%s" % (indent, label))
|
||||
for i in range(0, len(h), 60):
|
||||
print("%s %s" % (indent, h[i:i+60]))
|
||||
|
||||
show_file(sys.argv[1])
|
6344
third_party/python/python-stdlib.mk
vendored
6344
third_party/python/python-stdlib.mk
vendored
File diff suppressed because it is too large
Load diff
30
third_party/python/python.mk
vendored
30
third_party/python/python.mk
vendored
|
@ -306,6 +306,9 @@ THIRD_PARTY_PYTHON_OBJECTS_SRCS = \
|
|||
third_party/python/Objects/tupleobject.c \
|
||||
third_party/python/Objects/typeobject.c \
|
||||
third_party/python/Objects/unicodectype.c \
|
||||
third_party/python/Objects/unicodeislinebreak.c \
|
||||
third_party/python/Objects/unicodeiswhitespace.c \
|
||||
third_party/python/Objects/unicodetonumeric.c \
|
||||
third_party/python/Objects/unicodeobject.c \
|
||||
third_party/python/Objects/weakrefobject.c
|
||||
|
||||
|
@ -386,8 +389,11 @@ THIRD_PARTY_PYTHON_A_OBJS = \
|
|||
|
||||
THIRD_PARTY_PYTHON_BINS = \
|
||||
$(THIRD_PARTY_PYTHON_COMS) $(THIRD_PARTY_PYTHON_COMS:%=%.dbg)
|
||||
|
||||
THIRD_PARTY_PYTHON_COMS = \
|
||||
o/$(MODE)/third_party/python/python.com
|
||||
o/$(MODE)/third_party/python/python.com \
|
||||
o/$(MODE)/third_party/python/freeze.com \
|
||||
o/$(MODE)/third_party/python/pycomp.com
|
||||
|
||||
THIRD_PARTY_PYTHON_A_CHECKS = \
|
||||
$(THIRD_PARTY_PYTHON_A).pkg \
|
||||
|
@ -431,11 +437,33 @@ o/$(MODE)/third_party/python/python.com.dbg: \
|
|||
$(THIRD_PARTY_PYTHON_A_DEPS) \
|
||||
$(THIRD_PARTY_PYTHON_A) \
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_PY_OBJS) \
|
||||
$(THIRD_PARTY_PYTHON_STDLIB_PYC_OBJS) \
|
||||
o/$(MODE)/third_party/python/Programs/python.o \
|
||||
$(CRT) \
|
||||
$(APE)
|
||||
-@$(APELINK)
|
||||
|
||||
o/$(MODE)/third_party/python/pycomp: \
|
||||
o/$(MODE)/third_party/python/pycomp.com
|
||||
@cp -f $< $@
|
||||
@$@ -n
|
||||
|
||||
o/$(MODE)/third_party/python/pycomp.com.dbg: \
|
||||
$(THIRD_PARTY_PYTHON_A_DEPS) \
|
||||
$(THIRD_PARTY_PYTHON_A) \
|
||||
o/$(MODE)/third_party/python/pycomp.o \
|
||||
$(CRT) \
|
||||
$(APE)
|
||||
-@$(APELINK)
|
||||
|
||||
o/$(MODE)/third_party/python/freeze.com.dbg: \
|
||||
$(THIRD_PARTY_PYTHON_A_DEPS) \
|
||||
$(THIRD_PARTY_PYTHON_A) \
|
||||
o/$(MODE)/third_party/python/Programs/freeze.o \
|
||||
$(CRT) \
|
||||
$(APE)
|
||||
-@$(APELINK)
|
||||
|
||||
$(THIRD_PARTY_PYTHON_A): \
|
||||
third_party/python \
|
||||
$(THIRD_PARTY_PYTHON_A).pkg \
|
||||
|
|
|
@ -78,7 +78,7 @@ FLAGS\n\
|
|||
-V NUMBER specifies compiler version\n\
|
||||
-t touch target on success\n\
|
||||
-n do nothing (used to prime the executable)\n\
|
||||
-? print help\n\
|
||||
-h print help\n\
|
||||
\n"
|
||||
|
||||
struct Args {
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
char *StripComponents(const char *path, int n) {
|
||||
const char *p;
|
||||
while (n-- > 0) {
|
||||
while (*path == '/') ++path;
|
||||
for (p = path; *p; ++p) {
|
||||
if (*p == '/') {
|
||||
path = p + 1;
|
||||
|
|
Loading…
Reference in a new issue