Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
Line 9 is not where the error actually happened. The exception is raised not when you call Z(), but when you implicitly call Z.__str__() when evaluate the % operator. In Python 3.8 the traceback points to the start of the subexpression that raises an exception. So this issue has been fixed in 3.8. The fix was not backported to 3.7 because it is a large change which affects other code that traces execution or analyses tracebacks (e.g. coverage.py). ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37647> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com