Skip to content

Commit f96c909

Browse files
committed
fix missing PyLazyImport_CheckExact
1 parent b5121b0 commit f96c909

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Include/internal/pycore_lazyimportobject.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22

33
/* Lazy object interface */
44

5-
#ifndef Py_LAZYIMPORTOBJECT_H
6-
#define Py_LAZYIMPORTOBJECT_H
5+
#ifndef Py_INTERNAL_LAZYIMPORTOBJECT_H
6+
#define Py_INTERNAL_LAZYIMPORTOBJECT_H
7+
78
#ifdef __cplusplus
89
extern "C" {
910
#endif
1011

12+
#ifndef Py_BUILD_CORE
13+
# error "this header requires Py_BUILD_CORE define"
14+
#endif
15+
1116
PyAPI_DATA(PyTypeObject) PyLazyImport_Type;
1217
#define PyLazyImport_CheckExact(op) Py_IS_TYPE((op), &PyLazyImport_Type)
1318

@@ -28,4 +33,4 @@ PyAPI_FUNC(PyObject *) _PyLazyImport_New(PyObject *import_func, PyObject *from,
2833
#ifdef __cplusplus
2934
}
3035
#endif
31-
#endif /* !Py_LAZYIMPORTOBJECT_H */
36+
#endif /* !Py_INTERNAL_LAZYIMPORTOBJECT_H */

Python/bytecodes.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "pycore_instruments.h"
1818
#include "pycore_interpolation.h" // _PyInterpolation_Build()
1919
#include "pycore_intrinsics.h"
20+
#include "pycore_lazyimportobject.h" // PyLazyImport_CheckExact()
2021
#include "pycore_long.h" // _PyLong_ExactDealloc(), _PyLong_GetZero()
2122
#include "pycore_moduleobject.h" // PyModuleObject
2223
#include "pycore_object.h" // _PyObject_GC_TRACK()
@@ -2937,7 +2938,7 @@ dummy_func(
29372938
b = res ? PyStackRef_True : PyStackRef_False;
29382939
}
29392940

2940-
inst(IMPORT_NAME, (level, fromlist -- res)) {
2941+
inst(IMPORT_NAME, (level, fromlist -- res)) {
29412942
PyObject *name = GETITEM(FRAME_CO_NAMES, oparg >> 2);
29422943
PyObject *res_o;
29432944
if (!(oparg & 0x02)) {

Tools/jit/template.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "pycore_interpframe.h"
1616
#include "pycore_interpolation.h"
1717
#include "pycore_intrinsics.h"
18+
#include "pycore_lazyimportobject.h"
1819
#include "pycore_jit.h"
1920
#include "pycore_list.h"
2021
#include "pycore_long.h"

0 commit comments

Comments
 (0)