Skip to content

Commit 8f1105d

Browse files
committed
Update Python inlined files: 3.11.5
1 parent 41dc0f1 commit 8f1105d

File tree

1,091 files changed

+127890
-59389
lines changed

Some content is hidden

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

1,091 files changed

+127890
-59389
lines changed

graalpython/com.oracle.graal.python.cext/expat/expat_config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@
1818
#define XML_DTD 1
1919
#define XML_CONTEXT_BYTES 1024
2020

21+
// bpo-30947: Python uses best available entropy sources to
22+
// call XML_SetHashSalt(), expat entropy sources are not needed
23+
#define XML_POOR_ENTROPY 1
24+
2125
#endif /* EXPAT_CONFIG_H */

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

Lines changed: 29 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,56 @@
1+
// Entry point of the Python C API.
2+
// C extensions should only #include <Python.h>, and not include directly
3+
// the other Python header files included by <Python.h>.
4+
15
#ifndef Py_PYTHON_H
26
#define Py_PYTHON_H
3-
/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
47

5-
/* Include nearly all Python header files */
8+
// Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" {
69

10+
// Include Python header files
711
#include "patchlevel.h"
812
#include "pyconfig.h"
913
#include "pymacconfig.h"
1014

11-
#include <limits.h>
12-
13-
#ifndef UCHAR_MAX
14-
#error "Something's broken. UCHAR_MAX should be defined in limits.h."
15-
#endif
16-
17-
#if UCHAR_MAX != 255
18-
#error "Python's source code assumes C's unsigned char is an 8-bit type."
19-
#endif
20-
2115
#if defined(__sgi) && !defined(_SGI_MP_SOURCE)
22-
#define _SGI_MP_SOURCE
16+
# define _SGI_MP_SOURCE
2317
#endif
2418

25-
#include <stdio.h>
26-
#ifndef NULL
27-
# error "Python.h requires that stdio.h define NULL."
19+
// stdlib.h, stdio.h, errno.h and string.h headers are not used by Python
20+
// headers, but kept for backward compatibility. They are excluded from the
21+
// limited C API of Python 3.11.
22+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
23+
# include <stdlib.h>
24+
# include <stdio.h> // FILE*
25+
# include <errno.h> // errno
26+
# include <string.h> // memcpy()
2827
#endif
29-
30-
#include <string.h>
31-
#ifdef HAVE_ERRNO_H
32-
#include <errno.h>
33-
#endif
34-
#include <stdlib.h>
3528
#ifndef MS_WINDOWS
36-
#include <unistd.h>
29+
# include <unistd.h>
3730
#endif
38-
39-
/* For size_t? */
4031
#ifdef HAVE_STDDEF_H
41-
#include <stddef.h>
32+
# include <stddef.h> // size_t
4233
#endif
4334

44-
/* CAUTION: Build setups should ensure that NDEBUG is defined on the
45-
* compiler command line when building Python in release mode; else
46-
* assert() calls won't be removed.
47-
*/
48-
#include <assert.h>
35+
#include <assert.h> // assert()
36+
#include <wchar.h> // wchar_t
4937

5038
#include "pyport.h"
5139
#include "pymacro.h"
52-
53-
/* A convenient way for code to know if sanitizers are enabled. */
54-
#if defined(__has_feature)
55-
# if __has_feature(memory_sanitizer)
56-
# if !defined(_Py_MEMORY_SANITIZER)
57-
# define _Py_MEMORY_SANITIZER
58-
# endif
59-
# endif
60-
# if __has_feature(address_sanitizer)
61-
# if !defined(_Py_ADDRESS_SANITIZER)
62-
# define _Py_ADDRESS_SANITIZER
63-
# endif
64-
# endif
65-
#elif defined(__GNUC__)
66-
# if defined(__SANITIZE_ADDRESS__)
67-
# define _Py_ADDRESS_SANITIZER
68-
# endif
69-
#endif
70-
7140
#include "pymath.h"
7241
#include "pymem.h"
73-
42+
#include "pytypedefs.h"
43+
#include "pybuffer.h"
7444
#include "object.h"
7545
#include "objimpl.h"
7646
#include "typeslots.h"
7747
#include "pyhash.h"
78-
7948
#include "cpython/pydebug.h"
80-
8149
#include "bytearrayobject.h"
8250
#include "bytesobject.h"
8351
#include "unicodeobject.h"
8452
#include "longobject.h"
85-
#include "longintrepr.h"
53+
#include "cpython/longintrepr.h"
8654
#include "boolobject.h"
8755
#include "floatobject.h"
8856
#include "complexobject.h"
@@ -96,33 +64,30 @@
9664
#include "setobject.h"
9765
#include "methodobject.h"
9866
#include "moduleobject.h"
99-
#include "funcobject.h"
100-
#include "classobject.h"
67+
#include "cpython/funcobject.h"
68+
#include "cpython/classobject.h"
10169
#include "fileobject.h"
10270
#include "pycapsule.h"
103-
#include "code.h"
71+
#include "cpython/code.h"
10472
#include "pyframe.h"
10573
#include "traceback.h"
10674
#include "sliceobject.h"
107-
#include "cellobject.h"
75+
#include "cpython/cellobject.h"
10876
#include "iterobject.h"
10977
#include "cpython/initconfig.h"
110-
#include "genobject.h"
78+
#include "pystate.h"
79+
#include "cpython/genobject.h"
11180
#include "descrobject.h"
11281
#include "genericaliasobject.h"
11382
#include "warnings.h"
11483
#include "weakrefobject.h"
11584
#include "structseq.h"
116-
#include "namespaceobject.h"
11785
#include "cpython/picklebufobject.h"
11886
#include "cpython/pytime.h"
119-
12087
#include "codecs.h"
12188
#include "pyerrors.h"
12289
#include "pythread.h"
123-
#include "pystate.h"
124-
#include "context.h"
125-
90+
#include "cpython/context.h"
12691
#include "modsupport.h"
12792
#include "compile.h"
12893
#include "pythonrun.h"
@@ -132,12 +97,8 @@
13297
#include "osmodule.h"
13398
#include "intrcheck.h"
13499
#include "import.h"
135-
136100
#include "abstract.h"
137101
#include "bltinmodule.h"
138-
139-
#include "eval.h"
140-
141102
#include "cpython/pyctype.h"
142103
#include "pystrtod.h"
143104
#include "pystrcmp.h"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ PyAPI_FUNC(int) PyObject_IsSubclass(PyObject *object, PyObject *typeorclass);
863863

864864
#ifndef Py_LIMITED_API
865865
# define Py_CPYTHON_ABSTRACTOBJECT_H
866-
# include "cpython/abstract.h"
866+
# include "cpython/abstract.h"
867867
# undef Py_CPYTHON_ABSTRACTOBJECT_H
868868
#endif
869869

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ PyAPI_DATA(PyTypeObject) PyBool_Type;
1515
Don't forget to apply Py_INCREF() when returning either!!! */
1616

1717
/* Don't use these directly */
18-
PyAPI_DATA(struct _longobject) _Py_FalseStruct;
19-
PyAPI_DATA(struct _longobject) _Py_TrueStruct;
18+
PyAPI_DATA(PyLongObject) _Py_FalseStruct;
19+
PyAPI_DATA(PyLongObject) _Py_TrueStruct;
2020

2121
/* Use these macros */
2222
#define Py_False ((PyObject *) &_Py_FalseStruct)

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
extern "C" {
77
#endif
88

9-
#include <stdarg.h>
10-
119
/* Type PyByteArrayObject represents a mutable array of bytes.
1210
* The Python API is that of a sequence;
1311
* the bytes are mapped to ints in [0, 256).
@@ -36,7 +34,7 @@ PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t);
3634

3735
#ifndef Py_LIMITED_API
3836
# define Py_CPYTHON_BYTEARRAYOBJECT_H
39-
# include "cpython/bytearrayobject.h"
37+
# include "cpython/bytearrayobject.h"
4038
# undef Py_CPYTHON_BYTEARRAYOBJECT_H
4139
#endif
4240

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
extern "C" {
88
#endif
99

10-
#include <stdarg.h>
10+
#include <stdarg.h> // va_list
1111

1212
/*
1313
Type PyBytesObject represents a byte string. An extra zero byte is
@@ -59,7 +59,7 @@ PyAPI_FUNC(int) PyBytes_AsStringAndSize(
5959

6060
#ifndef Py_LIMITED_API
6161
# define Py_CPYTHON_BYTESOBJECT_H
62-
# include "cpython/bytesobject.h"
62+
# include "cpython/bytesobject.h"
6363
# undef Py_CPYTHON_BYTESOBJECT_H
6464
#endif
6565

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1+
/* Interface to random parts in ceval.c */
2+
13
#ifndef Py_CEVAL_H
24
#define Py_CEVAL_H
35
#ifdef __cplusplus
46
extern "C" {
57
#endif
68

79

8-
/* Interface to random parts in ceval.c */
10+
PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *);
11+
12+
PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyObject *co,
13+
PyObject *globals,
14+
PyObject *locals,
15+
PyObject *const *args, int argc,
16+
PyObject *const *kwds, int kwdc,
17+
PyObject *const *defs, int defc,
18+
PyObject *kwdefs, PyObject *closure);
919

1020
/* PyEval_CallObjectWithKeywords(), PyEval_CallObject(), PyEval_CallFunction
1121
* and PyEval_CallMethod are deprecated. Since they are officially part of the
@@ -148,7 +158,7 @@ PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);
148158

149159
#ifndef Py_LIMITED_API
150160
# define Py_CPYTHON_CEVAL_H
151-
# include "cpython/ceval.h"
161+
# include "cpython/ceval.h"
152162
# undef Py_CPYTHON_CEVAL_H
153163
#endif
154164

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

Lines changed: 0 additions & 20 deletions
This file was deleted.

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

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,61 +6,22 @@
66
extern "C" {
77
#endif
88

9-
#ifndef Py_LIMITED_API
10-
typedef struct {
11-
double real;
12-
double imag;
13-
} Py_complex;
14-
15-
/* Operations on complex numbers from complexmodule.c */
16-
17-
PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);
18-
PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);
19-
PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);
20-
PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex);
21-
PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex);
22-
PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex);
23-
PyAPI_FUNC(double) _Py_c_abs(Py_complex);
24-
#endif
25-
269
/* Complex object interface */
2710

28-
/*
29-
PyComplexObject represents a complex number with double-precision
30-
real and imaginary parts.
31-
*/
32-
#ifndef Py_LIMITED_API
33-
typedef struct {
34-
PyObject_HEAD
35-
Py_complex cval;
36-
} PyComplexObject;
37-
#endif
38-
3911
PyAPI_DATA(PyTypeObject) PyComplex_Type;
4012

4113
#define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
4214
#define PyComplex_CheckExact(op) Py_IS_TYPE(op, &PyComplex_Type)
4315

44-
#ifndef Py_LIMITED_API
45-
PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
46-
#endif
4716
PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);
4817

4918
PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);
5019
PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);
51-
#ifndef Py_LIMITED_API
52-
PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
53-
#endif
5420

55-
/* Format the object based on the format_spec, as defined in PEP 3101
56-
(Advanced String Formatting). */
5721
#ifndef Py_LIMITED_API
58-
PyAPI_FUNC(int) _PyComplex_FormatAdvancedWriter(
59-
_PyUnicodeWriter *writer,
60-
PyObject *obj,
61-
PyObject *format_spec,
62-
Py_ssize_t start,
63-
Py_ssize_t end);
22+
# define Py_CPYTHON_COMPLEXOBJECT_H
23+
# include "cpython/complexobject.h"
24+
# undef Py_CPYTHON_COMPLEXOBJECT_H
6425
#endif
6526

6627
#ifdef __cplusplus

0 commit comments

Comments
 (0)