On 3/06/2011 4:30 PM, Jacob Kruger wrote:
What I'm doing is trying to open a text file, but if it's not there, then I
tell the code to exit(), and while it works when running the source code using
the python executable, after I have run the code through py2exe, and then try
testing it, I get the following message:
Traceback (most recent call last):
File "mapData.py", line 39, in<module>
NameError: name 'exit' is not defined
The following is the actual little bit of code that's generating this after
being py2exe'ed - the last line is the line number being mentioned above:
try:
fData = open(sMapName + ".txt", "r")
except:
fData = None
finally:
if not bool(fData): print("invalid map name - " + sMapName + ".txt");
exit()
Any thoughts/ideas/alternative workarounds?
IIRC, exit() is added by site.py - I'd start looking what is going wrong
in that module in your environment...
Mark
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32