Extension module finalization?

Martin Sjögren martin at strakt.com
Thu Jan 17 03:31:47 EST 2002


On Tue, Jan 15, 2002 at 03:39:58PM +0100, Alex Martelli wrote:
> 
> "Martin Sjögren" <martin at strakt.com> wrote in message
> news:mailman.1011086782.28094.python-list at python.org...
> Hello
> 
> """
> When writing an extension module in C, you write an initfoo function that
> initializes the module. Is there a way to get a function called when the
> module is finalized? Like, if I want to do cleanup or stuff like that...
> """
> 
> I think the only "offical" way is:
> http://www.python.org/doc/current/lib/module-atexit.html
> 
> as modules don't get "finalized" until Python-exit time (if I
> understand correctly).

It will do, I think. I'm exploring the possibility to make a Python
wrapper for GNU TLS and they have a global_deinit function that I would
like to call.

[snip lots of ugly hacks ;)]

Thank you :)


Martin

-- 
Martin Sjögren
  martin at strakt.com              ICQ : 41245059
  Phone: +46 (0)31 7710870       Cell: +46 (0)739 169191
  GPG key: http://www.strakt.com/~martin/gpg.html




More information about the Python-list mailing list