summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2005-09-02 11:20:33 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2005-09-02 11:20:33 (GMT)
commitc384fc2357c02a3bc5628a23c6aea1a6bf7493cc (patch)
tree07a9af87a07ea4b2770ddfd2ca0a6e0013b1b756 /Lib
parentc1c956b281d05aac032b5f52c5d374de33bca26b (diff)
downloadcpython-c384fc2357c02a3bc5628a23c6aea1a6bf7493cc.zip
cpython-c384fc2357c02a3bc5628a23c6aea1a6bf7493cc.tar.gz
cpython-c384fc2357c02a3bc5628a23c6aea1a6bf7493cc.tar.bz2
Changed _srcfile determination to support py2exe.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/logging/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index e99234a..642b4ec 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -52,7 +52,9 @@ __date__ = "27 March 2005"
# _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__