Chromium Code Reviews| Index: gclient_utils.py |
| diff --git a/gclient_utils.py b/gclient_utils.py |
| index ab45d28cc6bed09de46c4163dde258dbf7de96c3..e2ab2868e553944dd324df4c461a6225075268dc 100644 |
| --- a/gclient_utils.py |
| +++ b/gclient_utils.py |
| @@ -769,3 +769,17 @@ def ParseCodereviewSettingsContent(content): |
| fix_url('CODE_REVIEW_SERVER') |
| fix_url('VIEW_VC') |
| return keyvals |
| + |
| + |
| +def NumLocalCpus(): |
| + """Returns the number of processors. |
| + |
| + Python on OSX 10.6 raises a NotImplementedError exception. |
| + """ |
| + try: |
| + # Multiprocessing |
| + import multiprocessing |
| + return multiprocessing.cpu_count() |
| + except: # pylint: disable=W0702 |
| + # Mac OS 10.6 |
| + return int(os.sysconf('SC_NPROCESSORS_ONLN')) |
|
M-A Ruel
2012/10/16 01:20:18
You want to # pylint: disable=E1101 here on Window
Isaac (away)
2012/10/16 04:23:32
Done, but I cribbed this function from swarm_clien
M-A Ruel
2012/10/16 11:18:21
I fixed it there a few hours ago. :) I rarely run
|