Skip to content

Commit

Permalink
[cpython] Remove ''.format() from the build.
Browse files Browse the repository at this point in the history
'linecounts-nativedeps' is down to 137,852 lines now.
  • Loading branch information
Andy Chu committed Oct 12, 2018
1 parent 4d10a3d commit 6731062
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Python-2.7.13/Objects/stringobject.c
Expand Up @@ -3595,6 +3595,7 @@ string_getnewargs(PyStringObject *v)
}


#ifndef OVM_MAIN
#include "stringlib/string_format.h"

PyDoc_STRVAR(format__doc__,
Expand Down Expand Up @@ -3636,6 +3637,7 @@ PyDoc_STRVAR(p_format__doc__,
"S.__format__(format_spec) -> string\n\
\n\
Return a formatted version of S as described by format_spec.");
#endif


static PyMethodDef
Expand Down Expand Up @@ -3681,10 +3683,12 @@ string_methods[] = {
{"rjust", (PyCFunction)string_rjust, METH_VARARGS, rjust__doc__},
{"center", (PyCFunction)string_center, METH_VARARGS, center__doc__},
{"zfill", (PyCFunction)string_zfill, METH_VARARGS, zfill__doc__},
#ifndef OVM_MAIN
{"format", (PyCFunction) do_string_format, METH_VARARGS | METH_KEYWORDS, format__doc__},
{"__format__", (PyCFunction) string__format__, METH_VARARGS, p_format__doc__},
{"_formatter_field_name_split", (PyCFunction) formatter_field_name_split, METH_NOARGS},
{"_formatter_parser", (PyCFunction) formatter_parser, METH_NOARGS},
#endif
{"encode", (PyCFunction)string_encode, METH_VARARGS | METH_KEYWORDS, encode__doc__},
{"decode", (PyCFunction)string_decode, METH_VARARGS | METH_KEYWORDS, decode__doc__},
{"expandtabs", (PyCFunction)string_expandtabs, METH_VARARGS,
Expand Down
6 changes: 5 additions & 1 deletion scripts/ovm.sh
Expand Up @@ -11,10 +11,14 @@ set -o errexit

source build/common.sh # $PY27

grep-python() {
grep-cpython() {
find $PY27 -type f | xargs grep "$@"
}

grep-cpython-c() {
find $PY27 -type f -a -name '*.[ch]' | xargs grep "$@"
}

# https://stackoverflow.com/questions/2224334/gcc-dump-preprocessor-defines

# 493 variables.
Expand Down

0 comments on commit 6731062

Please sign in to comment.