Skip to content

Commit

Permalink
pythongh-67224: Make linecache imports relative to improve startup speed
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal committed Apr 3, 2024
1 parent 1dc1521 commit 3a6a58b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Lib/linecache.py
Expand Up @@ -5,9 +5,6 @@
that name.
"""

import sys
import os

__all__ = ["getline", "clearcache", "checkcache", "lazycache"]


Expand Down Expand Up @@ -48,6 +45,7 @@ def getlines(filename, module_globals=None):


def checkcache(filename=None):
import os
"""Discard cache entries that are out of date.
(This is not checked upon each call!)"""

Expand Down Expand Up @@ -76,6 +74,9 @@ def checkcache(filename=None):


def updatecache(filename, module_globals=None):
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."""
Expand Down

0 comments on commit 3a6a58b

Please sign in to comment.