On Sat 3/07/2010 4:25 AM, Anthony Tuininga wrote:
On Thu, Jul 1, 2010 at 9:03 PM, Craig McQueen
<[email protected]> wrote:
I looked at the source code, and found that in the initscripts/Console.py--
http://cx-freeze.svn.sourceforge.net/viewvc/cx-freeze/trunk/initscripts/Console.py?revision=205&view=markup
--there are the following lines:
if sys.version_info[:2]>= (2, 5):
module = sys.modules.get("threading")
if module is not None:
module._shutdown()
If these lines are commented-out, then the error message at exit does not
occur.
Why are those lines there, and what is the consequence of me removing them?
Hi Craig,
The reason those lines are there is because without them any threads
that are currently running will simply die when the application ends.
The Python interpreter itself calls an internal routine that waits for
the threads to terminate on their own. Its unfortunate that this isn't
included inside Py_Finalize() but its not. Before Python 2.5, this was
done via means of an atexit function (which happened inside
Py_Finalize) but with Python 2.5 and up this has been changed to call
a special function within the main routine of the Python interpreter.
I have replicated the behavior using the above lines and that has
worked for me for some time. Would you be able to send me a sample
program that I can run and that demonstrates the problem? Thanks.
Anthony
I am just reading "What's new in Python 2.7" (since Python 2.7 has just been
released). I see it says:
* The Py_Finalize() <http://docs.python.org/c-api/init.html#Py_Finalize> function now calls the
internal threading._shutdown() function; this prevents some exceptions from being raised when an
interpreter shuts down. (Patch by Adam Olsen; issue 1722344 <http://bugs.python.org/issue1722344>.)
So does that call to threads._shutdown() in initscripts/Console.py need to be reviewed for usage
under Python 2.7?
Regards,
Craig McQueen
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
cx-freeze-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users