summaryrefslogtreecommitdiff
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2005-09-02 11:20:33 +0000
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2005-09-02 11:20:33 +0000
commitdd28ba99d6c5644e801bea2091f793e6fb26a39f (patch)
tree0c787f1a91627f5d507283b0f400631b0aba9b38 /Lib/logging
parentb4367514dd0d9e9b5d8c3e61a3f284bd1514bbb0 (diff)
downloadcpython-dd28ba99d6c5644e801bea2091f793e6fb26a39f.tar.gz
Changed _srcfile determination to support py2exe.
Diffstat (limited to 'Lib/logging')
-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 e99234a6ad..642b4ec3d5 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__