Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack trace includes aspectlib itself #4

Open
nedbat opened this issue Nov 16, 2015 · 1 comment
Open

Stack trace includes aspectlib itself #4

nedbat opened this issue Nov 16, 2015 · 1 comment

Comments

@nedbat
Copy link

nedbat commented Nov 16, 2015

It's easy to skip the aspectlib frames:

diff --git a/src/aspectlib/debug.py b/src/aspectlib/debug.py
index 2ee6225..85d13b5 100644
--- a/src/aspectlib/debug.py
+++ b/src/aspectlib/debug.py
@@ -20,7 +20,8 @@ def frame_iterator(frame):
     Yields frames till there are no more.
     """
     while frame:
-        yield frame
+        if "aspectlib" not in frame.f_code.co_filename.split(os.path.sep):
+            yield frame
         frame = frame.f_back 

But the tests fail because the frames they are looking for are excluded by this. Not sure how to fix that, other than adding an aspectlib=True flag to debug.log for the tests to use.

@ionelmc
Copy link
Owner

ionelmc commented Nov 16, 2015

I think those are safe to remove from the tests. On the other hand, self-debugging is useful, a skip_aspectlib kwarg might be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants