Skip to content

Commit 572f9d4

Browse files
committed
Update Python inlined files: Update to CPython 3.7.3
1 parent da9a962 commit 572f9d4

File tree

485 files changed

+20333
-4701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

485 files changed

+20333
-4701
lines changed

graalpython/com.oracle.graal.python.cext/include/ceval.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void);
4848
PyAPI_FUNC(PyObject *) PyEval_GetLocals(void);
4949
PyAPI_FUNC(struct _frame *) PyEval_GetFrame(void);
5050

51+
#ifndef Py_LIMITED_API
52+
/* Helper to look up a builtin object */
53+
PyAPI_FUNC(PyObject *) _PyEval_GetBuiltinId(_Py_Identifier *);
5154
/* Look at the current frame's (if any) code's co_flags, and turn on
5255
the corresponding compiler flags in cf->cf_flags. Return 1 if any
5356
flag was set, else return 0. */
54-
#ifndef Py_LIMITED_API
5557
PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
5658
#endif
5759

graalpython/com.oracle.graal.python.cext/include/import.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ PyAPI_FUNC(PyObject *) PyImport_AddModuleObject(
5454
PyObject *name
5555
);
5656
#endif
57-
#ifndef Py_LIMITED_API
58-
PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *, PyObject *);
59-
#endif
6057
PyAPI_FUNC(PyObject *) PyImport_AddModule(
6158
const char *name /* UTF-8 encoded string */
6259
);

graalpython/com.oracle.graal.python.cext/include/object.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ struct _Py_Identifier;
521521
PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);
522522
PyAPI_FUNC(void) _Py_BreakPoint(void);
523523
PyAPI_FUNC(void) _PyObject_Dump(PyObject *);
524+
PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);
524525
#endif
525526
PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *);
526527
PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *);

graalpython/com.oracle.graal.python.cext/include/patchlevel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
/*--start constants--*/
1919
#define PY_MAJOR_VERSION 3
2020
#define PY_MINOR_VERSION 7
21-
#define PY_MICRO_VERSION 0
21+
#define PY_MICRO_VERSION 3
2222
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
2323
#define PY_RELEASE_SERIAL 0
2424

2525
/* Version as a string */
26-
#define PY_VERSION "3.7.0"
26+
#define PY_VERSION "3.7.3"
2727
/*--end constants--*/
2828

2929
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.

graalpython/com.oracle.graal.python.cext/include/pyerrors.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *);
9494
#endif
9595

9696
#if defined(__clang__) || \
97-
(defined(__GNUC_MAJOR__) && \
98-
((__GNUC_MAJOR__ >= 3) || \
99-
(__GNUC_MAJOR__ == 2) && (__GNUC_MINOR__ >= 5)))
97+
(defined(__GNUC__) && \
98+
((__GNUC__ >= 3) || \
99+
(__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)))
100100
#define _Py_NO_RETURN __attribute__((__noreturn__))
101101
#else
102102
#define _Py_NO_RETURN

graalpython/com.oracle.graal.python.cext/include/pylifecycle.h

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,36 @@ PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
4444
PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void);
4545

4646
#ifndef Py_LIMITED_API
47+
PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *);
48+
4749
/* Only used by applications that embed the interpreter and need to
4850
* override the standard encoding determination mechanism
4951
*/
5052
PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding,
5153
const char *errors);
5254

5355
/* PEP 432 Multi-phase initialization API (Private while provisional!) */
54-
PyAPI_FUNC(_PyInitError) _Py_InitializeCore(const _PyCoreConfig *);
56+
PyAPI_FUNC(_PyInitError) _Py_InitializeCore(
57+
PyInterpreterState **interp_p,
58+
const _PyCoreConfig *config);
5559
PyAPI_FUNC(int) _Py_IsCoreInitialized(void);
60+
PyAPI_FUNC(_PyInitError) _Py_InitializeFromConfig(
61+
const _PyCoreConfig *config);
62+
#ifdef Py_BUILD_CORE
63+
PyAPI_FUNC(void) _Py_Initialize_ReadEnvVarsNoAlloc(void);
64+
#endif
65+
66+
PyAPI_FUNC(PyObject *) _Py_GetGlobalVariablesAsDict(void);
5667

5768
PyAPI_FUNC(_PyInitError) _PyCoreConfig_Read(_PyCoreConfig *);
5869
PyAPI_FUNC(void) _PyCoreConfig_Clear(_PyCoreConfig *);
5970
PyAPI_FUNC(int) _PyCoreConfig_Copy(
6071
_PyCoreConfig *config,
6172
const _PyCoreConfig *config2);
73+
PyAPI_FUNC(PyObject *) _PyCoreConfig_AsDict(const _PyCoreConfig *config);
74+
PyAPI_FUNC(void) _PyCoreConfig_SetGlobalConfig(
75+
const _PyCoreConfig *config);
76+
6277

6378
PyAPI_FUNC(_PyInitError) _PyMainInterpreterConfig_Read(
6479
_PyMainInterpreterConfig *config,
@@ -67,19 +82,26 @@ PyAPI_FUNC(void) _PyMainInterpreterConfig_Clear(_PyMainInterpreterConfig *);
6782
PyAPI_FUNC(int) _PyMainInterpreterConfig_Copy(
6883
_PyMainInterpreterConfig *config,
6984
const _PyMainInterpreterConfig *config2);
85+
/* Used by _testcapi.get_main_config() */
86+
PyAPI_FUNC(PyObject*) _PyMainInterpreterConfig_AsDict(
87+
const _PyMainInterpreterConfig *config);
88+
89+
PyAPI_FUNC(_PyInitError) _Py_InitializeMainInterpreter(
90+
PyInterpreterState *interp,
91+
const _PyMainInterpreterConfig *config);
92+
#endif /* !defined(Py_LIMITED_API) */
7093

71-
PyAPI_FUNC(_PyInitError) _Py_InitializeMainInterpreter(const _PyMainInterpreterConfig *);
72-
#endif
7394

7495
/* Initialization and finalization */
7596
PyAPI_FUNC(void) Py_Initialize(void);
7697
PyAPI_FUNC(void) Py_InitializeEx(int);
7798
#ifndef Py_LIMITED_API
78-
PyAPI_FUNC(_PyInitError) _Py_InitializeEx_Private(int, int);
7999
PyAPI_FUNC(void) _Py_FatalInitError(_PyInitError err) _Py_NO_RETURN;
80100
#endif
81101
PyAPI_FUNC(void) Py_Finalize(void);
102+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
82103
PyAPI_FUNC(int) Py_FinalizeEx(void);
104+
#endif
83105
PyAPI_FUNC(int) Py_IsInitialized(void);
84106

85107
/* Subinterpreter support */

graalpython/com.oracle.graal.python.cext/include/pymem.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ PyAPI_FUNC(int) PyTraceMalloc_Untrack(
5555
PyAPI_FUNC(PyObject*) _PyTraceMalloc_GetTraceback(
5656
unsigned int domain,
5757
uintptr_t ptr);
58-
#endif /* !Py_LIMITED_API */
58+
59+
PyAPI_FUNC(int) _PyMem_IsFreed(void *ptr, size_t size);
60+
#endif /* !defined(Py_LIMITED_API) */
5961

6062

6163
/* BEWARE:

graalpython/com.oracle.graal.python.cext/include/pystate.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ typedef struct {
7979
#define _PyCoreConfig_INIT \
8080
(_PyCoreConfig){ \
8181
.install_signal_handlers = -1, \
82+
.ignore_environment = -1, \
8283
.use_hash_seed = -1, \
8384
.coerce_c_locale = -1, \
85+
.faulthandler = -1, \
86+
.tracemalloc = -1, \
8487
.utf8_mode = -1, \
8588
.argc = -1, \
8689
.nmodule_search_path = -1}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
/* System module interface */
3+
4+
#ifndef Py_SYSMODULE_H
5+
#define Py_SYSMODULE_H
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
11+
PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *);
12+
#ifndef Py_LIMITED_API
13+
PyAPI_FUNC(PyObject *) _PySys_GetObjectId(_Py_Identifier *key);
14+
PyAPI_FUNC(int) _PySys_SetObjectId(_Py_Identifier *key, PyObject *);
15+
#endif
16+
17+
PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **);
18+
PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int);
19+
PyAPI_FUNC(void) PySys_SetPath(const wchar_t *);
20+
21+
PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
22+
Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
23+
PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
24+
Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
25+
PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...);
26+
PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...);
27+
28+
PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
29+
PyAPI_FUNC(void) PySys_AddWarnOption(const wchar_t *);
30+
PyAPI_FUNC(void) PySys_AddWarnOptionUnicode(PyObject *);
31+
PyAPI_FUNC(int) PySys_HasWarnOptions(void);
32+
33+
PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *);
34+
PyAPI_FUNC(PyObject *) PySys_GetXOptions(void);
35+
36+
#ifndef Py_LIMITED_API
37+
PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *);
38+
#endif
39+
40+
#ifdef Py_BUILD_CORE
41+
PyAPI_FUNC(int) _PySys_AddXOptionWithError(const wchar_t *s);
42+
PyAPI_FUNC(int) _PySys_AddWarnOptionWithError(PyObject *option);
43+
#endif
44+
45+
#ifdef __cplusplus
46+
}
47+
#endif
48+
#endif /* !Py_SYSMODULE_H */
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/* Do not renumber the file; these numbers are part of the stable ABI. */
2+
/* Disabled, see #10181 */
3+
#undef Py_bf_getbuffer
4+
#undef Py_bf_releasebuffer
5+
#define Py_mp_ass_subscript 3
6+
#define Py_mp_length 4
7+
#define Py_mp_subscript 5
8+
#define Py_nb_absolute 6
9+
#define Py_nb_add 7
10+
#define Py_nb_and 8
11+
#define Py_nb_bool 9
12+
#define Py_nb_divmod 10
13+
#define Py_nb_float 11
14+
#define Py_nb_floor_divide 12
15+
#define Py_nb_index 13
16+
#define Py_nb_inplace_add 14
17+
#define Py_nb_inplace_and 15
18+
#define Py_nb_inplace_floor_divide 16
19+
#define Py_nb_inplace_lshift 17
20+
#define Py_nb_inplace_multiply 18
21+
#define Py_nb_inplace_or 19
22+
#define Py_nb_inplace_power 20
23+
#define Py_nb_inplace_remainder 21
24+
#define Py_nb_inplace_rshift 22
25+
#define Py_nb_inplace_subtract 23
26+
#define Py_nb_inplace_true_divide 24
27+
#define Py_nb_inplace_xor 25
28+
#define Py_nb_int 26
29+
#define Py_nb_invert 27
30+
#define Py_nb_lshift 28
31+
#define Py_nb_multiply 29
32+
#define Py_nb_negative 30
33+
#define Py_nb_or 31
34+
#define Py_nb_positive 32
35+
#define Py_nb_power 33
36+
#define Py_nb_remainder 34
37+
#define Py_nb_rshift 35
38+
#define Py_nb_subtract 36
39+
#define Py_nb_true_divide 37
40+
#define Py_nb_xor 38
41+
#define Py_sq_ass_item 39
42+
#define Py_sq_concat 40
43+
#define Py_sq_contains 41
44+
#define Py_sq_inplace_concat 42
45+
#define Py_sq_inplace_repeat 43
46+
#define Py_sq_item 44
47+
#define Py_sq_length 45
48+
#define Py_sq_repeat 46
49+
#define Py_tp_alloc 47
50+
#define Py_tp_base 48
51+
#define Py_tp_bases 49
52+
#define Py_tp_call 50
53+
#define Py_tp_clear 51
54+
#define Py_tp_dealloc 52
55+
#define Py_tp_del 53
56+
#define Py_tp_descr_get 54
57+
#define Py_tp_descr_set 55
58+
#define Py_tp_doc 56
59+
#define Py_tp_getattr 57
60+
#define Py_tp_getattro 58
61+
#define Py_tp_hash 59
62+
#define Py_tp_init 60
63+
#define Py_tp_is_gc 61
64+
#define Py_tp_iter 62
65+
#define Py_tp_iternext 63
66+
#define Py_tp_methods 64
67+
#define Py_tp_new 65
68+
#define Py_tp_repr 66
69+
#define Py_tp_richcompare 67
70+
#define Py_tp_setattr 68
71+
#define Py_tp_setattro 69
72+
#define Py_tp_str 70
73+
#define Py_tp_traverse 71
74+
#define Py_tp_members 72
75+
#define Py_tp_getset 73
76+
#define Py_tp_free 74
77+
#define Py_nb_matrix_multiply 75
78+
#define Py_nb_inplace_matrix_multiply 76
79+
#define Py_am_await 77
80+
#define Py_am_aiter 78
81+
#define Py_am_anext 79
82+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
83+
/* New in 3.5 */
84+
#define Py_tp_finalize 80
85+
#endif

0 commit comments

Comments
 (0)