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

The problem of chapter B5.1 #201

Open
MaxforCherubim opened this issue Apr 19, 2024 · 1 comment
Open

The problem of chapter B5.1 #201

MaxforCherubim opened this issue Apr 19, 2024 · 1 comment

Comments

@MaxforCherubim
Copy link

The code is wrong.

from IPython.core.debugger import Pdb

def set_trace():
    Pdb(.set_trace(sys._getframe().f_back)

def debug(f, *args, **kwargs):
    pdb = Pdb()
    return pdb.runcall(f, *args, **kwargs)

It should be

from IPython.core.debugger import Pdb
import sys

def set_trace():
        Pdb.set_trace(sys._getframe().f_back)

def debug(f, *arg, **kwargs):
        pdb = Pdb()
        return pdb.runcall(f, *args, **kwargs)

But even the code get repaired, there still exist a AttributeError
AttributeError: 'frame' object has no attribute 'initial_frame'

@wesm
Copy link
Owner

wesm commented Jul 15, 2024

Thanks -- I will have a closer look at updating this for the latest version of Python

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