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.
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
Prevent pylint.run._cpu_count() from returning 0 #6903
Prevent pylint.run._cpu_count() from returning 0 #6903
Changes from 12 commits
cf15b86
ad2a076
9b6f9ba
e497479
f3ad888
d673d3f
9b062f5
25cef7f
56885a8
bd33be6
d7c8ee7
1cf920a
0854005
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little bit more explicit imo. I didn't know
0,1 == 0
so people might forget that as well later on.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0,1 == 0
can't happen here, as it's getting rounded to the nextint
soavail_cpu
is either0
or>=1
there. Nevertheless, what I also thought of was, if just shortcircuiting the return wouldn't be the more elegant solution:But yours is more explicit though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did apply your suggestion, but this is failing due to
avail_cpu
being initialized asNone
(a valid return value for this function imo) which does not work withmax
. My proposal above also doesn't work here. If the function doesn't find any of the files used to determine cpus, it is just wrong to return1
cpu available then.Therefore I just reverse that change to my initial implementaion, only in case of
avail_cpu == 0
this should be set automatically to1