Marc-Andre Lemburg <m...@egenix.com> added the comment:

To add some more context:

This came up while porting eGenix PyRun to Python 3.10. While installing 
setuptools 58.2.0 via "pyrun setup.py install", an exception was raised in 
getframeinfo().

PyRun uses exec() to run Python code:

    def pyrun_exec_code_file(filename, globals_dict, locals_dict=None):
        with open(filename, 'r', encoding='utf-8') as file:
            source = file.read()
        code = compile(source, filename, 'exec', optimize=pyrun_optimized)
        exec(code, globals_dict, locals_dict)

Using pdb, I then found that the top frame does not have f_lineno set in Python 
3.10.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45563>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to