Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
bcd4fbc3
Commit
bcd4fbc3
authored
Jan 19, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove pyston changes inside logging/__init__.py
parent
e401bf90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
from_cpython/Lib/logging/__init__.py
from_cpython/Lib/logging/__init__.py
+12
-12
No files found.
from_cpython/Lib/logging/__init__.py
View file @
bcd4fbc3
...
...
@@ -71,9 +71,15 @@ else:
_srcfile
=
__file__
_srcfile
=
os
.
path
.
normcase
(
_srcfile
)
# pyston changes: we don't support tb_frame or f_back, so always use sys._getframe
currentframe
=
lambda
:
sys
.
_getframe
(
4
)
start_getframe
=
4
# next bit filched from 1.5.2's inspect.py
def
currentframe
():
"""Return the frame object for the caller's stack frame."""
try
:
raise
Exception
except
:
return
sys
.
exc_info
()[
2
].
tb_frame
.
f_back
if
hasattr
(
sys
,
'_getframe'
):
currentframe
=
lambda
:
sys
.
_getframe
(
3
)
# done filching
# _srcfile is only used in conjunction with sys._getframe().
...
...
@@ -1222,23 +1228,17 @@ class Logger(Filterer):
Find the stack frame of the caller so that we can note the source
file name, line number and function name.
"""
f
=
currentframe
()
# pyston change: we can't use f_back to walk back up the stack, so increment a counter of
# frames to skip and repeatedly call sys._getframe
fn
=
start_getframe
#On some versions of IronPython, currentframe() returns None if
#IronPython isn't run with -X:Frames.
#
if f is not None:
#
f = f.f_back
if
f
is
not
None
:
f
=
f
.
f_back
rv
=
"(unknown file)"
,
0
,
"(unknown function)"
while
hasattr
(
f
,
"f_code"
):
co
=
f
.
f_code
filename
=
os
.
path
.
normcase
(
co
.
co_filename
)
if
filename
==
_srcfile
:
fn
+=
1
f
=
sys
.
_getframe
(
fn
);
#f = f.f_back
f
=
f
.
f_back
continue
rv
=
(
co
.
co_filename
,
f
.
f_lineno
,
co
.
co_name
)
break
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment