Mailing List Archive

linecache: Fix docstring location (#117948)
https://github.com/python/cpython/commit/dd4383f3c12fc938a445d974543f897c3fc07c0a
commit: dd4383f3c12fc938a445d974543f897c3fc07c0a
branch: main
author: Jelle Zijlstra <jelle.zijlstra@gmail.com>
committer: hauntsaninja <12621235+hauntsaninja@users.noreply.github.com>
date: 2024-04-16T15:37:18-07:00
summary:

linecache: Fix docstring location (#117948)

gh-117501 put some code before the docstring, so now it is no longer
recognized as a docstring.

files:
M Lib/linecache.py

diff --git a/Lib/linecache.py b/Lib/linecache.py
index d1113b108dc5e4..3462f1c451ba29 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -78,16 +78,15 @@ def checkcache(filename=None):


def updatecache(filename, module_globals=None):
- # These imports are not at top level because linecache is in the critical
- # path of the interpreter startup and importing os and sys take a lot of time
- # and slow down the startup sequence.
- import os
- import sys
-
"""Update a cache entry and return its list of lines.
If something's wrong, print a message, discard the cache entry,
and return an empty list."""

+ # These imports are not at top level because linecache is in the critical
+ # path of the interpreter startup and importing os and sys take a lot of time
+ # and slows down the startup sequence.
+ import os
+ import sys
import tokenize

if filename in cache:

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-leave@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: list-python-checkins@lists.gossamer-threads.com