linecache: Fix docstring location (#117948)

gh-117501 put some code before the docstring, so now it is no longer
recognized as a docstring.
This commit is contained in:
Jelle Zijlstra 2024-04-16 15:37:18 -07:00 committed by GitHub
parent d70ee13e57
commit dd4383f3c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 6 deletions

View File

@ -78,16 +78,15 @@ def checkcache(filename=None):
def updatecache(filename, module_globals=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. """Update a cache entry and return its list of lines.
If something's wrong, print a message, discard the cache entry, If something's wrong, print a message, discard the cache entry,
and return an empty list.""" 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 import tokenize
if filename in cache: if filename in cache: