unloading extension library

Bill Pursell bill.pursell at gmail.com
Wed Oct 18 15:12:26 EDT 2006


I've got a simple extension module that contains two functions:
void hi(void) __attribute__((constructor));
void hi(void) { printf("Hi!\n");}
void bye(void) __attribute__((destructor));
void bye(void) { printf("Bye!\n");}


When I run in the interpreter:

>>> import spam
Hi!
>>> del spam
>>>

Notice that the destructor isn't called.  How can I force python
to dlclose() the library and ensure that my destructors get called?


--
Bill Pursell




More information about the Python-list mailing list