Kaydet (Commit) dc8b5691 authored tarafından Guido van Rossum's avatar Guido van Rossum

Patch from Tim Peters to repare a the problem that tracebacks are off

by a line when Python is run with -x.
üst 9bcd1d79
...@@ -197,8 +197,15 @@ Py_Main(argc, argv) ...@@ -197,8 +197,15 @@ Py_Main(argc, argv)
exit(2); exit(2);
} }
else if (skipfirstline) { else if (skipfirstline) {
char line[256]; int ch;
fgets(line, sizeof line, fp); /* Push back first newline so line numbers
remain the same */
while ((ch = getc(fp)) != EOF) {
if (ch == '\n') {
(void)ungetc(ch, fp);
break;
}
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment