Bill Pursell wrote:
del sys.modules["spam"]
del spam
>
> Should remove all the references, but I still don't want to wait for
> garbage collection. I need to be sure that the dlclose() happens
> and the destructors are called. Can I do that? (without relying
> on ctypes, preferrably.)
Bill Pursell wrote:
> 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:
>
> >>> i
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
>>>
Notic