As a test case this is easy to reproduce. Try the following
nodel.py:
class NoDel:
def __del__(self):
print 'running __del__ for class NoDel'
nodelinst = NoDel()
both the frozen and unfrozen apps yield:
running __del__ for class NoDel
Now try:
nodel.py:
class NoDel:
def __del__(self):
print 'running __del__ for class NoDel'
nodelinst = NoDel()
raise AttributeError
and the unfrozen app gives
Traceback (most recent call last):
File "nodelraise.py", line 7, in <module>
raise AttributeError
AttributeError
running __del__ for class NoDel
while the frozen app gives:
Traceback (most recent call last):
File "c:\Python25\lib\site-packages\cx_Freeze\initscripts\Console.py",
line 29
, in <module>
exec code in m.__dict__
File "nodelraise.py", line 7, in <module>
raise AttributeError
AttributeError
Note that the destructor is not called.
Jeffery G. Smith
MedPlus, A Quest Diagnostics Company | Senior SCM Specialist | 4690
Parkway Drive | Mason, OH 45040 USA | phone +1.513.204.2601 | fax
+1.513.229.5505 | mobile +1.513.335.1517 | [email protected] |
www.MedPlus.com <http://www.medplus.com/>
Please think about resource conservation before you print this message
________________________________
From: Smith, Jeff [mailto:[email protected]]
Sent: Friday, April 17, 2009 3:03 PM
To: [email protected]
Subject: [cx-freeze-users] __del__ not getting called in frozen app
I have a __del__ method on a class that doesn't get called on my frozen
app when the app throws an exception. I am using cx_Freeze 4.0.1 with
Python 2.5.4 and see this on Windows and Linux.
Oddly enough, I see the same thing on Mac OS X with py2app.
Has anyone seen similar behavior?
Jeffery G. Smith
MedPlus, A Quest Diagnostics Company | Senior SCM Specialist | 4690
Parkway Drive | Mason, OH 45040 USA | phone +1.513.204.2601 | fax
+1.513.229.5505 | mobile +1.513.335.1517 | [email protected] |
www.MedPlus.com <http://www.medplus.com/>
Please think about resource conservation before you print this message
Confidentiality Notice: The information contained in this electronic
transmission is confidential and may be legally privileged. It is
intended only for the addressee(s) named above. If you are not an
intended recipient, be aware that any disclosure, copying, distribution
or use of the information contained in this transmission is prohibited
and may be unlawful. If you have received this transmission in error,
please notify us by telephone (513) 229-5500 or by email
([email protected]). After replying, please erase it from your
computer system.
Confidentiality Notice: The information contained in this electronic
transmission is confidential and may be legally privileged. It is intended only
for the addressee(s) named above. If you are not an intended recipient, be
aware that any disclosure, copying, distribution or use of the information
contained in this transmission is prohibited and may be unlawful. If you have
received this transmission in error, please notify us by telephone (513)
229-5500 or by email ([email protected]). After replying, please erase it
from your computer system.
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
cx-freeze-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users