Skip to content

Stack trace includes aspectlib itself #4

Open
@nedbat

Description

@nedbat

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.

Activity

ionelmc

ionelmc commented on Nov 16, 2015

@ionelmc
Owner

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Stack trace includes aspectlib itself · Issue #4 · ionelmc/python-aspectlib