Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 1898:20f17b5accbf legacy-trunk
* Python/pythonrun.c (print_error): print only last line of
multi-line source line
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 19 Sep 1994 08:08:50 +0000 |
| parents | ac6a9f90f6fd |
| children | a7f269610ec2 |
comparison
equal
deleted
inserted
replaced
| 1897:3fbda8768855 | 1898:20f17b5accbf |
|---|---|
| 284 writestring("\", line ", f); | 284 writestring("\", line ", f); |
| 285 sprintf(buf, "%d", lineno); | 285 sprintf(buf, "%d", lineno); |
| 286 writestring(buf, f); | 286 writestring(buf, f); |
| 287 writestring("\n", f); | 287 writestring("\n", f); |
| 288 if (text != NULL) { | 288 if (text != NULL) { |
| 289 char *nl; | |
| 290 if (offset > 0 && | |
| 291 offset == strlen(text)) | |
| 292 offset--; | |
| 293 for (;;) { | |
| 294 nl = strchr(text, '\n'); | |
| 295 if (nl == NULL || | |
| 296 nl-text >= offset) | |
| 297 break; | |
| 298 offset -= (nl+1-text); | |
| 299 text = nl+1; | |
| 300 } | |
| 289 while (*text == ' ' || *text == '\t') { | 301 while (*text == ' ' || *text == '\t') { |
| 290 text++; | 302 text++; |
| 291 offset--; | 303 offset--; |
| 292 } | 304 } |
| 293 writestring(" ", f); | 305 writestring(" ", f); |
