Skip to content

Commit bdf7e7f

Browse files
authored
Merge pull request #455 from mattip/pypy-fixes
backport changes from PyPy
2 parents f611473 + 189d60d commit bdf7e7f

31 files changed

+148
-62
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,8 @@ jobs:
292292
- name: Set up Python
293293
uses: actions/setup-python@v4
294294
with:
295-
python-version: '3.x'
295+
# autogen needs distutils
296+
python-version: '3.11'
296297

297298
- name: Install/Upgrade Python dependencies
298299
run: python -m pip install --upgrade pip wheel

hpy/debug/src/_debugmod.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
static UHPy new_DebugHandleObj(HPyContext *uctx, UHPy u_DebugHandleType,
1111
DebugHandle *handle);
1212

13-
HPY_MOD_EMBEDDABLE(_trace)
13+
HPY_MOD_EMBEDDABLE(_debug)
1414

1515
HPyDef_METH(new_generation, "new_generation", HPyFunc_NOARGS)
1616
static UHPy new_generation_impl(HPyContext *uctx, UHPy self)

hpy/debug/src/autogen_debug_ctx_init.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hpy/debug/src/debug_ctx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ const char *debug_ctx_Bytes_AS_STRING(HPyContext *dctx, DHPy h)
256256
return (const char *)protect_and_associate_data_ptr(h, (void *)ptr, data_size);
257257
}
258258

259-
DHPy debug_ctx_Tuple_FromArray(HPyContext *dctx, DHPy dh_items[], HPy_ssize_t n)
259+
DHPy debug_ctx_Tuple_FromArray(HPyContext *dctx, const DHPy dh_items[], HPy_ssize_t n)
260260
{
261261
if (!get_ctx_info(dctx)->is_valid) {
262262
report_invalid_debug_context();

hpy/devel/include/hpy/hpytype.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,16 @@ typedef struct {
202202
#define HPy_TPFLAGS_HAVE_GC (1UL << 14)
203203

204204
/** Convenience macro which is equivalent to:
205-
``HPyType_HELPERS(TYPE, HPyType_BuiltinShape_Legacy)`` */
205+
``HPyType_HELPERS(TYPE, HPyType_BuiltinShape_Legacy)``
206+
For instance, HPyType_LEGACY_HELPERS(DummyMeta) will produce::
207+
208+
enum { DummyMeta_SHAPE = (int)HPyType_BuiltinShape_Legacy };
209+
__attribute__((unused)) static inline
210+
DummyMeta *
211+
DummyMeta_AsStruct(HPyContext *ctx, HPy h) {
212+
return (DummyMeta *) _HPy_AsStruct_Legacy(ctx, h);
213+
}
214+
*/
206215
#define HPyType_LEGACY_HELPERS(TYPE) \
207216
HPyType_HELPERS(TYPE, HPyType_BuiltinShape_Legacy)
208217

hpy/devel/include/hpy/runtime/ctx_funcs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ _HPy_HIDDEN void ctx_TupleBuilder_Cancel(HPyContext *ctx,
5656
HPyTupleBuilder builder);
5757

5858
// ctx_tuple.c
59-
_HPy_HIDDEN HPy ctx_Tuple_FromArray(HPyContext *ctx, HPy items[], HPy_ssize_t n);
59+
_HPy_HIDDEN HPy ctx_Tuple_FromArray(HPyContext *ctx, const HPy items[], HPy_ssize_t n);
6060

6161
// ctx_capsule.c
6262
_HPy_HIDDEN HPy ctx_Capsule_New(HPyContext *ctx,

hpy/devel/include/hpy/universal/autogen_ctx.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hpy/devel/include/hpy/universal/autogen_trampolines.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hpy/devel/src/runtime/ctx_tuple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
_HPy_HIDDEN HPy
11-
ctx_Tuple_FromArray(HPyContext *ctx, HPy items[], HPy_ssize_t n)
11+
ctx_Tuple_FromArray(HPyContext *ctx, const HPy items[], HPy_ssize_t n)
1212
{
1313
PyObject *res = PyTuple_New(n);
1414
if (!res)

hpy/tools/autogen/public_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ HPy HPyDict_Copy(HPyContext *ctx, HPy h);
739739
HPy_ID(203)
740740
int HPyTuple_Check(HPyContext *ctx, HPy h);
741741
HPy_ID(204)
742-
HPy HPyTuple_FromArray(HPyContext *ctx, HPy items[], HPy_ssize_t n);
742+
HPy HPyTuple_FromArray(HPyContext *ctx, const HPy items[], HPy_ssize_t n);
743743
// note: HPyTuple_Pack is implemented as a macro in common/macros.h
744744

745745
/* sliceobject.h */

0 commit comments

Comments
 (0)