◐ Shell
clean mode source ↗

gh-103956: fix `trace` output in case of missing source line by chgnrdv · Pull Request #103958 · python/cpython

check if call to `linecache.getline` returns non-empty string
otherwise print only filename with lineno

@bedevere-bot mentioned this pull request

Apr 27, 2023

@blurb-it

serhiy-storchaka

…on into trace-fix-lacking-newlines

serhiy-storchaka

@chgnrdv

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 9, 2024
…ythonGH-103958)

Print only filename with lineno if linecache.getline() returns an empty string.
(cherry picked from commit 7c87ce7)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 9, 2024
…ythonGH-103958)

Print only filename with lineno if linecache.getline() returns an empty string.
(cherry picked from commit 7c87ce7)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 9, 2024
…ythonGH-103958)

Print only filename with lineno if linecache.getline() returns an empty string.
(cherry picked from commit 7c87ce7)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>

serhiy-storchaka pushed a commit that referenced this pull request

May 9, 2024
…H-103958) (GH-118832)

Print only filename with lineno if linecache.getline() returns an empty string.
(cherry picked from commit 7c87ce7)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>

serhiy-storchaka pushed a commit that referenced this pull request

May 9, 2024
…H-103958) (GH-118834)

Print only filename with lineno if linecache.getline() returns an empty string.
(cherry picked from commit 7c87ce7)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>

SonicField pushed a commit to SonicField/cpython that referenced this pull request

May 9, 2024
…ythonGH-103958)

Print only filename with lineno if linecache.getline() returns an empty string.