Skip to content

Commit 000f296

Browse files
committed
support for python 3.10
1 parent e4c94b0 commit 000f296

File tree

166 files changed

+18628
-174
lines changed

Some content is hidden

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

166 files changed

+18628
-174
lines changed

frozendict/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.6
1+
2.0.7

frozendict/core.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ def _immutable(self, *args, **kwargs):
88

99
raise AttributeError(f"'{self.__class__.__name__}' object is read-only")
1010

11+
def _immutable_type(self, *args, **kwargs):
12+
r"""
13+
Same as function above, but raises a TypeError
14+
"""
15+
16+
raise TypeError(f"'{self.__class__.__name__}' object is read-only")
1117

1218
class frozendict(dict):
1319
r"""
@@ -161,6 +167,6 @@ def __delitem__(self, key, *args, **kwargs):
161167
frozendict.update = _immutable
162168
frozendict.__delattr__ = _immutable
163169
frozendict.__setattr__ = _immutable
164-
frozendict.__ior__ = _immutable
170+
frozendict.__ior__ = _immutable_type
165171

166172
__all__ = (frozendict.__name__, )

frozendict/src/3_10/cpython_src/Include/Python.h

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@
3535
#ifndef MS_WINDOWS
3636
#include <unistd.h>
3737
#endif
38+
#ifdef HAVE_CRYPT_H
39+
#if defined(HAVE_CRYPT_R) && !defined(_GNU_SOURCE)
40+
/* Required for glibc to expose the crypt_r() function prototype. */
41+
# define _GNU_SOURCE
42+
# define _Py_GNU_SOURCE_FOR_CRYPT
43+
#endif
44+
#include <crypt.h>
45+
#ifdef _Py_GNU_SOURCE_FOR_CRYPT
46+
/* Don't leak the _GNU_SOURCE define to other headers. */
47+
# undef _GNU_SOURCE
48+
# undef _Py_GNU_SOURCE_FOR_CRYPT
49+
#endif
50+
#endif
3851

3952
/* For size_t? */
4053
#ifdef HAVE_STDDEF_H
@@ -50,34 +63,33 @@
5063
#include "pyport.h"
5164
#include "pymacro.h"
5265

53-
/* A convenient way for code to know if clang's memory sanitizer is enabled. */
66+
/* A convenient way for code to know if sanitizers are enabled. */
5467
#if defined(__has_feature)
5568
# if __has_feature(memory_sanitizer)
5669
# if !defined(_Py_MEMORY_SANITIZER)
5770
# define _Py_MEMORY_SANITIZER
5871
# endif
5972
# endif
73+
# if __has_feature(address_sanitizer)
74+
# if !defined(_Py_ADDRESS_SANITIZER)
75+
# define _Py_ADDRESS_SANITIZER
76+
# endif
77+
# endif
78+
#elif defined(__GNUC__)
79+
# if defined(__SANITIZE_ADDRESS__)
80+
# define _Py_ADDRESS_SANITIZER
81+
# endif
6082
#endif
6183

62-
/* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
63-
* PYMALLOC_DEBUG is in error if pymalloc is not in use.
64-
*/
65-
#if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG)
66-
#define PYMALLOC_DEBUG
67-
#endif
68-
#if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC)
69-
#error "PYMALLOC_DEBUG requires WITH_PYMALLOC"
70-
#endif
7184
#include "pymath.h"
72-
#include "pytime.h"
7385
#include "pymem.h"
7486

7587
#include "object.h"
7688
#include "objimpl.h"
7789
#include "typeslots.h"
7890
#include "pyhash.h"
7991

80-
#include "pydebug.h"
92+
#include "cpython/pydebug.h"
8193

8294
#include "bytearrayobject.h"
8395
#include "bytesobject.h"
@@ -92,7 +104,7 @@
92104
#include "tupleobject.h"
93105
#include "listobject.h"
94106
#include "dictobject.h"
95-
#include "odictobject.h"
107+
#include "cpython/odictobject.h"
96108
#include "enumobject.h"
97109
#include "setobject.h"
98110
#include "methodobject.h"
@@ -114,7 +126,8 @@
114126
#include "weakrefobject.h"
115127
#include "structseq.h"
116128
#include "namespaceobject.h"
117-
#include "picklebufobject.h"
129+
#include "cpython/picklebufobject.h"
130+
#include "cpython/pytime.h"
118131

119132
#include "codecs.h"
120133
#include "pyerrors.h"
@@ -124,11 +137,9 @@
124137
#include "pystate.h"
125138
#include "context.h"
126139

127-
#include "pyarena.h"
128140
#include "modsupport.h"
129141
#include "compile.h"
130142
#include "pythonrun.h"
131-
#include "parser_interface.h"
132143
#include "pylifecycle.h"
133144
#include "ceval.h"
134145
#include "sysmodule.h"
@@ -141,11 +152,11 @@
141152

142153
#include "eval.h"
143154

144-
#include "pyctype.h"
155+
#include "cpython/pyctype.h"
145156
#include "pystrtod.h"
146157
#include "pystrcmp.h"
147158
#include "fileutils.h"
148-
#include "pyfpe.h"
159+
#include "cpython/pyfpe.h"
149160
#include "tracemalloc.h"
150161

151162
#endif /* !Py_PYTHON_H */
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
The Python C API
2+
================
3+
4+
The C API is divided into three sections:
5+
6+
1. ``Include/``: Limited API
7+
2. ``Include/cpython/``: CPython implementation details
8+
3. ``Include/internal/``: The internal API
9+
10+
Information on changing the C API is available `in the developer guide`_
11+
12+
.. _in the developer guide: https://devguide.python.org/c-api/

0 commit comments

Comments
 (0)