[Python-checkins] python/dist/src/Lib/logging __init__.py, 1.27, 1.28
vsajip@users.sourceforge.net
vsajip at users.sourceforge.net
Fri Sep 2 13:20:46 CEST 2005
Update of /cvsroot/python/python/dist/src/Lib/logging
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21191
Modified Files:
__init__.py
Log Message:
Changed _srcfile determination to support py2exe.
Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/logging/__init__.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- __init__.py 31 Mar 2005 20:16:55 -0000 1.27
+++ __init__.py 2 Sep 2005 11:20:33 -0000 1.28
@@ -52,7 +52,9 @@
# _srcfile is used when walking the stack to check when we've got the first
# caller stack frame.
#
-if string.lower(__file__[-4:]) in ['.pyc', '.pyo']:
+if hasattr(sys, 'frozen'): #support for py2exe
+ _srcfile = "logging%s__init__%s" % (os.sep, __file__[-4:])
+elif string.lower(__file__[-4:]) in ['.pyc', '.pyo']:
_srcfile = __file__[:-4] + '.py'
else:
_srcfile = __file__
More information about the Python-checkins
mailing list