diff --git a/Lib/linecache.py b/Lib/linecache.py index dc02de19eb6..2b5a31b3e75 100644 --- a/Lib/linecache.py +++ b/Lib/linecache.py @@ -63,6 +63,16 @@ def _getlines_from_code(code): return [] +def _source_unavailable(filename): + """Return True if the source code is unavailable for such file name.""" + return ( + not filename + or (filename.startswith('<') + and filename.endswith('>') + and not filename.startswith('')): + if _source_unavailable(filename): return [] - fullname = filename + if filename.startswith('