Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19907 > unrolled thread

Re: nested embedding of interpreter

Started byAntoine Pitrou <solipsis@pitrou.net>
First post2012-02-06 19:59 +0000
Last post2012-02-06 19:59 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: nested embedding of interpreter Antoine Pitrou <solipsis@pitrou.net> - 2012-02-06 19:59 +0000

#19907 — Re: nested embedding of interpreter

FromAntoine Pitrou <solipsis@pitrou.net>
Date2012-02-06 19:59 +0000
SubjectRe: nested embedding of interpreter
Message-ID<mailman.5484.1328558381.27778.python-list@python.org>
Hello,

Eric Frederich <eric.frederich <at> gmail.com> writes:
> 
> 1)Is calling Py_Initialize twice correct, or will I run into other problems
> down the road?

It's fine in practice (spurious calls are ignored).

> I am not sure if there is a mechanism to get something called at the end of
the 
> user's session with the program though, so is it a problem if I don't call
> Py_Finalize at the end?

Yes, it's a problem. If you don't call Py_Finalize, atexit handlers, object
destructors and the like will not be called. These include destructors of file
objects (including stdout): any buffering in a still-open file opened for
writing can be lost.

Regards

Antoine.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web