Skip to content

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Apr 3, 2024

@pablogsal
Copy link
Member Author

Oh man, seems this is complicated because making the import lazy actually fails at shutdown because if the first time this is called its when the interpreter is shutting down, sys.meta_path is None :(

@pablogsal
Copy link
Member Author

Well, I think this should do the trick

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just a suggestion to reorganize checkcache() import/except ImportError.

@pablogsal pablogsal merged commit 689ada7 into python:main Apr 10, 2024
@pablogsal pablogsal deleted the gh-67224-2 branch April 10, 2024 19:09
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull request Apr 16, 2024
pythongh-117501 put some code before the docstring, so now it is no longer
recognized as a docstring.
# and slow down the startup sequence.
import os
import sys

"""Update a cache entry and return its list of lines.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We lost the docstring because you put the imports before it. Filed #117948 to fix this.

hauntsaninja pushed a commit that referenced this pull request Apr 16, 2024
gh-117501 put some code before the docstring, so now it is no longer
recognized as a docstring.
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
pythongh-117501 put some code before the docstring, so now it is no longer
recognized as a docstring.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants