R. David Murray added the comment:
Yes, when you change the code on disk, you must restart the Python interpreter
in order for it to "see" those changes. And as I said, the source code is
never held in memory, so the only source code the traceback can show is what is
on disk. This is just h
Guy added the comment:
I was running a script that I was editing, and, after making changes, the code
wasn't reinterpreted, but listed the line that the "error" occured on (I had
corrected the error on the file that was on disk, but yet, Python didn't
reinterpret the code).
"I'm guessing you
R. David Murray added the comment:
Yes, this is the way it works. There is no copy of the lines kept in memory,
the only lines that can be displayed in the traceback are the ones currently on
disk.
Although your speaking about a "script" is a bit confusing: if you are running
a script from
New submission from Guy :
When an exception is raised and Python's showing a traceback, the lines of the
Python scripts are that of those on-disk, not in memory.
For example, if I run a Python script which raises an exception, but I edit the
line the exception occurs on and save the script in