Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cad3d47

Browse files
committed
Chris Herborth writes:
Donn Cave tells me the PyImport_BeImageID() function isn't needed anymore.
1 parent d3b0921 commit cad3d47

1 file changed

Lines changed: 4 additions & 38 deletions

File tree

Python/importdl.c

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,6 @@ static void beos_init_dyn( void );
205205
static void beos_cleanup_dyn( void );
206206
static void beos_nuke_dyn( PyObject *item );
207207
static void beos_add_dyn( char *pathname, image_id id );
208-
209-
/* External interface for finding image IDs; useful if you need to
210-
* do your own symbol lookup in dynamically loaded modules. [Donn Cave]
211-
*
212-
* Hmm, could we hack up the Sun dlmodule instead for this sort of thing?
213-
* That might be more generally useful. [chrish]
214-
*/
215-
image_id PyImport_BeImageID( char *name );
216208
#endif
217209

218210
#ifdef DYNAMIC_LINK
@@ -985,6 +977,10 @@ aix_loaderror(pathname)
985977
* Python without thread support; the 1.5 version required it, which wasn't
986978
* very friendly. Note that I haven't tested it without threading... why
987979
* would you want to avoid threads on BeOS? [chrish]
980+
*
981+
* As of 1.5.2, the PyImport_BeImageID() function has been removed; Donn
982+
* tells me it's not necessary anymore because of PyCObject_Import().
983+
* [chrish]
988984
*/
989985

990986
/*
@@ -1092,34 +1088,4 @@ static void beos_add_dyn( char *name, image_id id )
10921088
#endif
10931089
}
10941090

1095-
/* Given a module name, return the image_id (if it's a dynamically loaded
1096-
* module). [Donn Cave]
1097-
*/
1098-
image_id PyImport_BeImageID( char *name )
1099-
{
1100-
int retval;
1101-
PyObject *py_id;
1102-
long id;
1103-
1104-
if( !beos_dyn_images ) {
1105-
return B_ERROR;
1106-
}
1107-
1108-
#ifdef WITH_THREAD
1109-
retval = PyThread_acquire_lock( beos_dyn_lock, 1 );
1110-
#endif
1111-
1112-
py_id = PyDict_GetItemString( beos_dyn_images, name );
1113-
if( py_id ) {
1114-
id = PyInt_AsLong( py_id );
1115-
} else {
1116-
id = B_ERROR;
1117-
}
1118-
1119-
#ifdef WITH_THREAD
1120-
PyThread_release_lock( beos_dyn_lock );
1121-
#endif
1122-
1123-
return (image_id)id;
1124-
}
11251091
#endif /* __BEOS__ */

0 commit comments

Comments
 (0)