]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Changed _srcfile determination to support py2exe.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 2 Sep 2005 11:20:33 +0000 (11:20 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 2 Sep 2005 11:20:33 +0000 (11:20 +0000)
Lib/logging/__init__.py

index e99234a6addcad6ea360ea517b4cab30a44f0996..642b4ec3d5c30469ec8f1d12ce4c69aeae4d59cb 100644 (file)
@@ -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__