@@ -96,9 +96,9 @@ get_encoded_name(PyObject *name, const char **hook_prefix) {
96
96
void
97
97
_Py_ext_module_loader_info_clear (struct _Py_ext_module_loader_info * info )
98
98
{
99
- Py_CLEAR (info -> path );
99
+ Py_CLEAR (info -> filename );
100
100
#ifndef MS_WINDOWS
101
- Py_CLEAR (info -> path_encoded );
101
+ Py_CLEAR (info -> filename_encoded );
102
102
#endif
103
103
Py_CLEAR (info -> name );
104
104
Py_CLEAR (info -> name_encoded );
@@ -134,15 +134,15 @@ _Py_ext_module_loader_info_init_from_spec(
134
134
return -1 ;
135
135
}
136
136
137
- info .path = PyObject_GetAttrString (spec , "origin" );
138
- if (info .path == NULL ) {
137
+ info .filename = PyObject_GetAttrString (spec , "origin" );
138
+ if (info .filename == NULL ) {
139
139
_Py_ext_module_loader_info_clear (& info );
140
140
return -1 ;
141
141
}
142
142
143
143
#ifndef MS_WINDOWS
144
- info .path_encoded = PyUnicode_EncodeFSDefault (info .path );
145
- if (info .path_encoded == NULL ) {
144
+ info .filename_encoded = PyUnicode_EncodeFSDefault (info .filename );
145
+ if (info .filename_encoded == NULL ) {
146
146
_Py_ext_module_loader_info_clear (& info );
147
147
return -1 ;
148
148
}
@@ -165,10 +165,10 @@ _PyImport_LoadDynamicModuleWithSpec(struct _Py_ext_module_loader_info *info,
165
165
166
166
#ifdef MS_WINDOWS
167
167
exportfunc = _PyImport_FindSharedFuncptrWindows (
168
- info -> hook_prefix , name_buf , info -> path , fp );
168
+ info -> hook_prefix , name_buf , info -> filename , fp );
169
169
#else
170
170
{
171
- const char * path_buf = PyBytes_AS_STRING (info -> path_encoded );
171
+ const char * path_buf = PyBytes_AS_STRING (info -> filename_encoded );
172
172
exportfunc = _PyImport_FindSharedFuncptr (
173
173
info -> hook_prefix , name_buf , path_buf , fp );
174
174
}
@@ -182,7 +182,7 @@ _PyImport_LoadDynamicModuleWithSpec(struct _Py_ext_module_loader_info *info,
182
182
"module export function (%s_%s)" ,
183
183
info -> hook_prefix , name_buf );
184
184
if (msg != NULL ) {
185
- PyErr_SetImportError (msg , info -> name , info -> path );
185
+ PyErr_SetImportError (msg , info -> name , info -> filename );
186
186
Py_DECREF (msg );
187
187
}
188
188
}
@@ -252,12 +252,14 @@ _PyImport_LoadDynamicModuleWithSpec(struct _Py_ext_module_loader_info *info,
252
252
def -> m_base .m_init = p0 ;
253
253
254
254
/* Remember the filename as the __file__ attribute */
255
- if (PyModule_AddObjectRef (m , "__file__" , info -> path ) < 0 ) {
255
+ if (PyModule_AddObjectRef (m , "__file__" , info -> filename ) < 0 ) {
256
256
PyErr_Clear (); /* Not important enough to report */
257
257
}
258
258
259
259
PyObject * modules = PyImport_GetModuleDict ();
260
- if (_PyImport_FixupExtensionObject (m , info -> name , info -> path , modules ) < 0 ) {
260
+ if (_PyImport_FixupExtensionObject (
261
+ m , info -> name , info -> filename , modules ) < 0 )
262
+ {
261
263
goto error ;
262
264
}
263
265
0 commit comments