File tree Expand file tree Collapse file tree 5 files changed +6
-9
lines changed
Expand file tree Collapse file tree 5 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 5959
6060from ._bootstrap import __import__
6161
62- from _imp import lazy_import , set_lazy_imports
62+ from _imp import set_lazy_imports
6363
6464
6565def invalidate_caches ():
Original file line number Diff line number Diff line change @@ -2790,7 +2790,7 @@ def test_lazy_import_pkg_cross_import(self):
27902790
27912791 g = test .test_import .data .lazy_imports .pkg .c .get_globals ()
27922792 self .assertEqual (type (g ["x" ]), int )
2793- self .assertEqual (type (g ["b" ]), importlib . lazy_import )
2793+ self .assertEqual (type (g ["b" ]), types . LazyImportType )
27942794
27952795class TestSinglePhaseSnapshot (ModuleSnapshot ):
27962796 """A representation of a single-phase init module for testing.
Original file line number Diff line number Diff line change 22
33#include "Python.h"
44#include "pycore_descrobject.h" // _PyMethodWrapper_Type
5+ #include "pycore_lazyimportobject.h" // PyLazyImport_Type
56#include "pycore_namespace.h" // _PyNamespace_Type
67#include "pycore_object.h" // _PyNone_Type, _PyNotImplemented_Type
78#include "pycore_unionobject.h" // _PyUnion_Type
@@ -35,6 +36,7 @@ _types_exec(PyObject *m)
3536 EXPORT_STATIC_TYPE ("GetSetDescriptorType" , PyGetSetDescr_Type );
3637 // LambdaType is the same as FunctionType
3738 EXPORT_STATIC_TYPE ("LambdaType" , PyFunction_Type );
39+ EXPORT_STATIC_TYPE ("LazyImportType" , PyLazyImport_Type );
3840 EXPORT_STATIC_TYPE ("MappingProxyType" , PyDictProxy_Type );
3941 EXPORT_STATIC_TYPE ("MemberDescriptorType" , PyMemberDescr_Type );
4042 EXPORT_STATIC_TYPE ("MethodDescriptorType" , PyMethodDescr_Type );
Original file line number Diff line number Diff line change @@ -144,8 +144,8 @@ static PyMethodDef lazy_methods[] = {
144144
145145PyTypeObject PyLazyImport_Type = {
146146 PyVarObject_HEAD_INIT (& PyType_Type , 0 )
147- "lazy_import" , /* tp_name */
148- sizeof (PyLazyImportObject ), /* tp_basicsize */
147+ "LazyImport" , /* tp_name */
148+ sizeof (PyLazyImportObject ), /* tp_basicsize */
149149 0 , /* tp_itemsize */
150150 (destructor )lazy_import_dealloc , /* tp_dealloc */
151151 0 , /* tp_print */
Original file line number Diff line number Diff line change @@ -5377,11 +5377,6 @@ imp_module_exec(PyObject *module)
53775377 return -1 ;
53785378 }
53795379
5380- if (PyModule_AddObjectRef (module , "lazy_import" ,
5381- (PyObject * )& PyLazyImport_Type ) < 0 ) {
5382- return -1 ;
5383- }
5384-
53855380 return 0 ;
53865381}
53875382
You can’t perform that action at this time.
0 commit comments