Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-102038: Skip a sometimes unnecessary stat in site.py #102039

Merged
merged 4 commits into from
Apr 2, 2023

Conversation

hauntsaninja
Copy link
Contributor

@hauntsaninja hauntsaninja commented Feb 19, 2023

I also changed the exe_dir assignment to use os.path.dirname. This is exactly equivalent to os.path.split(...)[0]; the only reason we used split was refactoring in 27e4b60

@@ -0,0 +1 @@
Skip a ``stat`` in :mod:`site` if we have already found a ``pyvenv.cfg``
Copy link
Contributor

Choose a reason for hiding this comment

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

With stat you mean the os.path.isfile check that is skipped? I am unfamiliar with the term, but from the news entry alone I did not understand this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, an unnecessary os.path.isfile is skipped. "stat" here comes from the name of the syscall: https://en.wikipedia.org/wiki/Stat_(system_call)

Copy link
Contributor

@eendebakpt eendebakpt left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@hauntsaninja hauntsaninja merged commit 385b5d6 into python:main Apr 2, 2023
@hauntsaninja hauntsaninja deleted the gh-102038 branch April 2, 2023 22:47
gaogaotiantian pushed a commit to gaogaotiantian/cpython that referenced this pull request Apr 8, 2023
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants