use ninja importability to determine python-ninja usability#1378
Closed
ngam wants to merge 2 commits intogoogle:mainfrom
Closed
use ninja importability to determine python-ninja usability#1378ngam wants to merge 2 commits intogoogle:mainfrom
ngam wants to merge 2 commits intogoogle:mainfrom
Conversation
|
Also xref: #1376 (should be marked as closing that ticket). |
| ]) | ||
| if sys.executable is not None: | ||
| importable = importlib.util.find_spec(module or binary) | ||
| if sys.executable is not None and importable is not None: |
Contributor
There was a problem hiding this comment.
this can be just ... and importable since find_spec does not return anything else that evaluates to False
Contributor
Author
There was a problem hiding this comment.
Do you prefer a one-liner or a two-liner?
Contributor
There was a problem hiding this comment.
i prefer the two-liner, the variable name importable does add a nice bit of readability.
Contributor
|
thanks, that looks like a great fix! sorry for all the conda issues. |
Contributor
|
looks good, i'll merge it internally (retaining you as author) and push it out as part of the next pytype release |
Contributor
Author
|
Perfect, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1376
There doesn't seem to be a need to force people to use python-ninja when the ninja binary is available. The logic is better now such that if python-ninja isn't available (importable), the command can fall back to ninja the binary.
xref:
thanks to: