Skip to content

Commit d7d1602

Browse files
authored
Merge pull request #4 from jgarzik/updates
3.12 compliance fixes and Updates
2 parents c89f85f + 2d23ca4 commit d7d1602

79 files changed

Lines changed: 8461 additions & 154 deletions

Some content is hidden

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

Makefile

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,83 @@ gen-cpython-tests:
9090
@$(PYTHON) -m py_compile tests/cpython/test_scope.py
9191
@echo "Compiling tests/cpython/test_generators.py..."
9292
@$(PYTHON) -m py_compile tests/cpython/test_generators.py
93+
@echo "Compiling tests/cpython/test_unary.py..."
94+
@$(PYTHON) -m py_compile tests/cpython/test_unary.py
95+
@echo "Compiling tests/cpython/test_pow.py..."
96+
@$(PYTHON) -m py_compile tests/cpython/test_pow.py
97+
@echo "Compiling tests/cpython/test_contains.py..."
98+
@$(PYTHON) -m py_compile tests/cpython/test_contains.py
99+
@echo "Compiling tests/cpython/test_exception_variations.py..."
100+
@$(PYTHON) -m py_compile tests/cpython/test_exception_variations.py
101+
@echo "Compiling tests/cpython/test_genexps.py..."
102+
@$(PYTHON) -m py_compile tests/cpython/test_genexps.py
103+
@echo "Compiling tests/cpython/test_listcomps.py..."
104+
@$(PYTHON) -m py_compile tests/cpython/test_listcomps.py
105+
@echo "Compiling tests/cpython/test_raise.py..."
106+
@$(PYTHON) -m py_compile tests/cpython/test_raise.py
107+
@echo "Compiling tests/cpython/test_class.py..."
108+
@$(PYTHON) -m py_compile tests/cpython/test_class.py
109+
@echo "Compiling tests/cpython/test_compare.py..."
110+
@$(PYTHON) -m py_compile tests/cpython/test_compare.py
111+
@echo "Compiling tests/cpython/test_with.py..."
112+
@$(PYTHON) -m py_compile tests/cpython/test_with.py
113+
@echo "Compiling tests/cpython/test_opcodes.py..."
114+
@$(PYTHON) -m py_compile tests/cpython/test_opcodes.py
115+
@echo "Compiling tests/cpython/test_baseexception.py..."
116+
@$(PYTHON) -m py_compile tests/cpython/test_baseexception.py
117+
@echo "Compiling tests/cpython/test_extcall.py..."
118+
@$(PYTHON) -m py_compile tests/cpython/test_extcall.py
119+
@echo "Compiling tests/cpython/test_iter.py..."
120+
@$(PYTHON) -m py_compile tests/cpython/test_iter.py
121+
@echo "Compiling tests/cpython/test_lambda.py..."
122+
@$(PYTHON) -m py_compile tests/cpython/test_lambda.py
123+
@echo "Compiling tests/cpython/test_property.py..."
124+
@$(PYTHON) -m py_compile tests/cpython/test_property.py
125+
@echo "Compiling tests/cpython/test_string.py..."
126+
@$(PYTHON) -m py_compile tests/cpython/test_string.py
127+
@echo "Compiling tests/cpython/test_bytes.py..."
128+
@$(PYTHON) -m py_compile tests/cpython/test_bytes.py
129+
@echo "Compiling tests/cpython/test_builtin.py..."
130+
@$(PYTHON) -m py_compile tests/cpython/test_builtin.py
131+
@echo "Compiling tests/cpython/test_types.py..."
132+
@$(PYTHON) -m py_compile tests/cpython/test_types.py
133+
@echo "Compiling tests/cpython/test_closures.py..."
134+
@$(PYTHON) -m py_compile tests/cpython/test_closures.py
135+
@echo "Compiling tests/cpython/test_dict_extra.py..."
136+
@$(PYTHON) -m py_compile tests/cpython/test_dict_extra.py
137+
@echo "Compiling tests/cpython/test_tuple_extra.py..."
138+
@$(PYTHON) -m py_compile tests/cpython/test_tuple_extra.py
139+
@echo "Compiling tests/cpython/test_set_extra.py..."
140+
@$(PYTHON) -m py_compile tests/cpython/test_set_extra.py
141+
@echo "Compiling tests/cpython/test_list_extra.py..."
142+
@$(PYTHON) -m py_compile tests/cpython/test_list_extra.py
143+
@echo "Compiling tests/cpython/test_controlflow.py..."
144+
@$(PYTHON) -m py_compile tests/cpython/test_controlflow.py
145+
@echo "Compiling tests/cpython/test_math_basic.py..."
146+
@$(PYTHON) -m py_compile tests/cpython/test_math_basic.py
147+
@echo "Compiling tests/cpython/test_global_nonlocal.py..."
148+
@$(PYTHON) -m py_compile tests/cpython/test_global_nonlocal.py
149+
@echo "Compiling tests/cpython/test_unpacking.py..."
150+
@$(PYTHON) -m py_compile tests/cpython/test_unpacking.py
151+
@echo "Compiling tests/cpython/test_inheritance.py..."
152+
@$(PYTHON) -m py_compile tests/cpython/test_inheritance.py
153+
@$(PYTHON) -m py_compile tests/cpython/test_del.py
154+
@$(PYTHON) -m py_compile tests/cpython/test_assert.py
155+
@$(PYTHON) -m py_compile tests/cpython/test_assignment.py
156+
@$(PYTHON) -m py_compile tests/cpython/test_exceptions_extra.py
157+
@$(PYTHON) -m py_compile tests/cpython/test_generators_extra.py
158+
@$(PYTHON) -m py_compile tests/cpython/test_format.py
159+
@$(PYTHON) -m py_compile tests/cpython/test_slice_ops.py
160+
@$(PYTHON) -m py_compile tests/cpython/test_numeric.py
161+
@$(PYTHON) -m py_compile tests/cpython/test_comprehensions.py
162+
@$(PYTHON) -m py_compile tests/cpython/test_decorators_extra.py
163+
@$(PYTHON) -m py_compile tests/cpython/test_walrus.py
164+
@$(PYTHON) -m py_compile tests/cpython/test_match.py
165+
@$(PYTHON) -m py_compile tests/cpython/test_datastructures.py
166+
@$(PYTHON) -m py_compile tests/cpython/test_exceptions_builtin.py
167+
@$(PYTHON) -m py_compile tests/cpython/test_functions.py
168+
@$(PYTHON) -m py_compile tests/cpython/test_range_extra.py
169+
@$(PYTHON) -m py_compile tests/cpython/test_conditional.py
93170
@echo "Done."
94171

95172
check-cpython: $(TARGET) gen-cpython-tests
@@ -127,3 +204,97 @@ check-cpython: $(TARGET) gen-cpython-tests
127204
@./apython tests/cpython/__pycache__/test_scope.cpython-312.pyc
128205
@echo "Running CPython test_generators.py..."
129206
@./apython tests/cpython/__pycache__/test_generators.cpython-312.pyc
207+
@echo "Running CPython test_unary.py..."
208+
@./apython tests/cpython/__pycache__/test_unary.cpython-312.pyc
209+
@echo "Running CPython test_pow.py..."
210+
@./apython tests/cpython/__pycache__/test_pow.cpython-312.pyc
211+
@echo "Running CPython test_contains.py..."
212+
@./apython tests/cpython/__pycache__/test_contains.cpython-312.pyc
213+
@echo "Running CPython test_exception_variations.py..."
214+
@./apython tests/cpython/__pycache__/test_exception_variations.cpython-312.pyc
215+
@echo "Running CPython test_genexps.py..."
216+
@./apython tests/cpython/__pycache__/test_genexps.cpython-312.pyc
217+
@echo "Running CPython test_listcomps.py..."
218+
@./apython tests/cpython/__pycache__/test_listcomps.cpython-312.pyc
219+
@echo "Running CPython test_raise.py..."
220+
@./apython tests/cpython/__pycache__/test_raise.cpython-312.pyc
221+
@echo "Running CPython test_class.py..."
222+
@./apython tests/cpython/__pycache__/test_class.cpython-312.pyc
223+
@echo "Running CPython test_compare.py..."
224+
@./apython tests/cpython/__pycache__/test_compare.cpython-312.pyc
225+
@echo "Running CPython test_with.py..."
226+
@./apython tests/cpython/__pycache__/test_with.cpython-312.pyc
227+
@echo "Running CPython test_opcodes.py..."
228+
@./apython tests/cpython/__pycache__/test_opcodes.cpython-312.pyc
229+
@echo "Running CPython test_baseexception.py..."
230+
@./apython tests/cpython/__pycache__/test_baseexception.cpython-312.pyc
231+
@echo "Running CPython test_extcall.py..."
232+
@./apython tests/cpython/__pycache__/test_extcall.cpython-312.pyc
233+
@echo "Running CPython test_iter.py..."
234+
@./apython tests/cpython/__pycache__/test_iter.cpython-312.pyc
235+
@echo "Running CPython test_lambda.py..."
236+
@./apython tests/cpython/__pycache__/test_lambda.cpython-312.pyc
237+
@echo "Running CPython test_property.py..."
238+
@./apython tests/cpython/__pycache__/test_property.cpython-312.pyc
239+
@echo "Running CPython test_string.py..."
240+
@./apython tests/cpython/__pycache__/test_string.cpython-312.pyc
241+
@echo "Running CPython test_bytes.py..."
242+
@./apython tests/cpython/__pycache__/test_bytes.cpython-312.pyc
243+
@echo "Running CPython test_builtin.py..."
244+
@./apython tests/cpython/__pycache__/test_builtin.cpython-312.pyc
245+
@echo "Running CPython test_types.py..."
246+
@./apython tests/cpython/__pycache__/test_types.cpython-312.pyc
247+
@echo "Running CPython test_closures.py..."
248+
@./apython tests/cpython/__pycache__/test_closures.cpython-312.pyc
249+
@echo "Running CPython test_dict_extra.py..."
250+
@./apython tests/cpython/__pycache__/test_dict_extra.cpython-312.pyc
251+
@echo "Running CPython test_tuple_extra.py..."
252+
@./apython tests/cpython/__pycache__/test_tuple_extra.cpython-312.pyc
253+
@echo "Running CPython test_set_extra.py..."
254+
@./apython tests/cpython/__pycache__/test_set_extra.cpython-312.pyc
255+
@echo "Running CPython test_list_extra.py..."
256+
@./apython tests/cpython/__pycache__/test_list_extra.cpython-312.pyc
257+
@echo "Running CPython test_controlflow.py..."
258+
@./apython tests/cpython/__pycache__/test_controlflow.cpython-312.pyc
259+
@echo "Running CPython test_math_basic.py..."
260+
@./apython tests/cpython/__pycache__/test_math_basic.cpython-312.pyc
261+
@echo "Running CPython test_global_nonlocal.py..."
262+
@./apython tests/cpython/__pycache__/test_global_nonlocal.cpython-312.pyc
263+
@echo "Running CPython test_unpacking.py..."
264+
@./apython tests/cpython/__pycache__/test_unpacking.cpython-312.pyc
265+
@echo "Running CPython test_inheritance.py..."
266+
@./apython tests/cpython/__pycache__/test_inheritance.cpython-312.pyc
267+
@echo "Running CPython test_del.py..."
268+
@./apython tests/cpython/__pycache__/test_del.cpython-312.pyc
269+
@echo "Running CPython test_assert.py..."
270+
@./apython tests/cpython/__pycache__/test_assert.cpython-312.pyc
271+
@echo "Running CPython test_assignment.py..."
272+
@./apython tests/cpython/__pycache__/test_assignment.cpython-312.pyc
273+
@echo "Running CPython test_exceptions_extra.py..."
274+
@./apython tests/cpython/__pycache__/test_exceptions_extra.cpython-312.pyc
275+
@echo "Running CPython test_generators_extra.py..."
276+
@./apython tests/cpython/__pycache__/test_generators_extra.cpython-312.pyc
277+
@echo "Running CPython test_format.py..."
278+
@./apython tests/cpython/__pycache__/test_format.cpython-312.pyc
279+
@echo "Running CPython test_slice_ops.py..."
280+
@./apython tests/cpython/__pycache__/test_slice_ops.cpython-312.pyc
281+
@echo "Running CPython test_numeric.py..."
282+
@./apython tests/cpython/__pycache__/test_numeric.cpython-312.pyc
283+
@echo "Running CPython test_comprehensions.py..."
284+
@./apython tests/cpython/__pycache__/test_comprehensions.cpython-312.pyc
285+
@echo "Running CPython test_decorators_extra.py..."
286+
@./apython tests/cpython/__pycache__/test_decorators_extra.cpython-312.pyc
287+
@echo "Running CPython test_walrus.py..."
288+
@./apython tests/cpython/__pycache__/test_walrus.cpython-312.pyc
289+
@echo "Running CPython test_match.py..."
290+
@./apython tests/cpython/__pycache__/test_match.cpython-312.pyc
291+
@echo "Running CPython test_datastructures.py..."
292+
@./apython tests/cpython/__pycache__/test_datastructures.cpython-312.pyc
293+
@echo "Running CPython test_exceptions_builtin.py..."
294+
@./apython tests/cpython/__pycache__/test_exceptions_builtin.cpython-312.pyc
295+
@echo "Running CPython test_functions.py..."
296+
@./apython tests/cpython/__pycache__/test_functions.cpython-312.pyc
297+
@echo "Running CPython test_range_extra.py..."
298+
@./apython tests/cpython/__pycache__/test_range_extra.cpython-312.pyc
299+
@echo "Running CPython test_conditional.py..."
300+
@./apython tests/cpython/__pycache__/test_conditional.cpython-312.pyc

include/errcodes.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ struc PyExceptionObject
4646
.exc_context: resq 1 ; +48: ptr to __context__ or NULL
4747
.exc_cause: resq 1 ; +56: ptr to __cause__ or NULL
4848
.exc_args: resq 1 ; +64: ptr to args tuple or NULL
49+
.exc_dict: resq 1 ; +72: ptr to instance dict or NULL (for custom attrs)
4950
endstruc
5051

5152
; Exception group object (extends PyExceptionObject with eg_exceptions)
@@ -59,7 +60,8 @@ struc PyExceptionGroupObject
5960
.exc_context: resq 1 ; +48
6061
.exc_cause: resq 1 ; +56
6162
.exc_args: resq 1 ; +64
62-
.eg_exceptions: resq 1 ; +72: tuple of sub-exceptions
63+
.exc_dict: resq 1 ; +72: ptr to instance dict or NULL
64+
.eg_exceptions: resq 1 ; +80: tuple of sub-exceptions
6365
endstruc
6466

6567
; Traceback object

lib/abc.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# abc.py - Abstract Base Classes (minimal stub for apython)
2+
3+
def abstractmethod(funcobj):
4+
"""Decorator indicating abstract methods."""
5+
funcobj.__isabstractmethod__ = True
6+
return funcobj
7+
8+
class ABCMeta(type):
9+
"""Metaclass for defining Abstract Base Classes (ABCs)."""
10+
pass
11+
12+
class ABC(metaclass=ABCMeta):
13+
"""Helper class that provides a standard way to create an ABC using inheritance."""
14+
__slots__ = ()

0 commit comments

Comments
 (0)