From: Vinay Sajip Date: Fri, 2 Sep 2005 11:20:33 +0000 (+0000) Subject: Changed _srcfile determination to support py2exe. X-Git-Tag: v2.5a0~1407 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c384fc2357c02a3bc5628a23c6aea1a6bf7493cc;p=thirdparty%2FPython%2Fcpython.git Changed _srcfile determination to support py2exe. --- diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index e99234a6addc..642b4ec3d5c3 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__