Fix T45955: Python's pdb can't show script source
This commit is contained in:
parent
a603a3470c
commit
5f64b77ca5
Notes:
blender-bot
2023-02-14 08:42:51 +01:00
Referenced by issue #45955, Python debugger cannot display source for scripts
|
@ -491,7 +491,9 @@ static int python_script_exec(bContext *C, const char *fn, struct Text *text,
|
|||
* incompatible'.
|
||||
* So now we load the script file data to a buffer */
|
||||
{
|
||||
const char *pystring = "with open(__file__, 'r') as f: exec(f.read())";
|
||||
const char *pystring =
|
||||
"ns = globals().copy()\n"
|
||||
"with open(__file__, 'rb') as f: exec(compile(f.read(), __file__, 'exec'), ns)";
|
||||
|
||||
fclose(fp);
|
||||
|
||||
|
|
Loading…
Reference in New Issue