Skip to content

Commit dd4383f

Browse files
linecache: Fix docstring location (#117948)
gh-117501 put some code before the docstring, so now it is no longer recognized as a docstring.
1 parent d70ee13 commit dd4383f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Lib/linecache.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,15 @@ def checkcache(filename=None):
7878

7979

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

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

9392
if filename in cache:

0 commit comments

Comments
 (0)