gh-98718: re-use already calculated is_python_build from getpath#98719
gh-98718: re-use already calculated is_python_build from getpath#98719FFY00 wants to merge 1 commit intopython:mainfrom
Conversation
665bcf7 to
080a70a
Compare
|
Seems fine to me, though I assume some others have more opinions about tacking stuff onto the |
|
I think the biggest win here is really unifying the logic in one place. |
|
Does not it need documentation? Would not it be more useful to expose |
As proposed, I see it as an internal implementation detail, so wouldn't be documented.
+1. |
jaraco
left a comment
There was a problem hiding this comment.
LGTM, but I'm unsure about the correctness. Is sys._is_python_build always a correct indicator at runtime? How can we have more confidence it's the correct value in different scenarios?
Nope, but we don't have a proper one. Any marker file could disappear or be copied, so we may as well look for the things we actually care about (stdlib modules) and guess, rather than look for something that's there solely to help us guess. At least if we expose it properly, it'll be easier to change it to something more reliable if we come up with one. |
Signed-off-by: Filipe Laíns <lains@riseup.net>
It's missing a news entry, but other than that, no, it's an internal change.
We can do that. The reason I didn't do it here was because I didn't want to add any more public API, so I just used the already exported |
080a70a to
eaa03ca
Compare
This also gets rid of the duplicated logic.