Skip to content

Commit

Permalink
linecache: Fix docstring location (python#117948)
Browse files Browse the repository at this point in the history
pythongh-117501 put some code before the docstring, so now it is no longer
recognized as a docstring.
  • Loading branch information
JelleZijlstra authored and diegorusso committed Apr 17, 2024
1 parent f539091 commit 5be600f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Lib/linecache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5be600f

Please sign in to comment.