mirror of
https://github.com/python/cpython.git
synced 2025-07-21 18:25:22 +00:00
Changed _srcfile determination to support py2exe.
This commit is contained in:
parent
c1c956b281
commit
c384fc2357
1 changed files with 3 additions and 1 deletions
|
@ -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__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue