Skip to content

Commit

Permalink
Revert "Use inspect.stack() instead of sys._getframe()"
Browse files Browse the repository at this point in the history
This reverts commit b1c366a.
  • Loading branch information
luhn committed Apr 15, 2019
1 parent a85ddab commit 1ad6a99
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pyramid/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,10 @@ def __init__(self, **settings):

def _get_info(self):
depth = self.__dict__.get('_depth', 0)
frameinfo = inspect.stack()[depth + 2]
sourceline = frameinfo[4][0].strip()
self._info = frameinfo[1], frameinfo[2], frameinfo[3], sourceline
frame = sys._getframe(depth + 2)
frameinfo = inspect.getframeinfo(frame)
sourceline = frameinfo[3][0].strip()
self._info = frameinfo[0], frameinfo[1], frameinfo[2], sourceline

def __call__(self, wrapped):
settings = self.__dict__.copy()
Expand Down

0 comments on commit 1ad6a99

Please sign in to comment.