mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-28 10:46:15 +01:00
Merge branch 'missing_os_sysconf' of https://github.com/marcus-h/osc
Handle missing os.sysconf more gracefully.
This commit is contained in:
commit
5fdcecfbab
@ -87,11 +87,11 @@ except:
|
||||
def _get_processors():
|
||||
"""
|
||||
get number of processors (online) based on
|
||||
SC_NPROCESSORS_ONLN (returns 1 if config name does not exist).
|
||||
SC_NPROCESSORS_ONLN (returns 1 if config name/os.sysconf does not exist).
|
||||
"""
|
||||
try:
|
||||
return os.sysconf('SC_NPROCESSORS_ONLN')
|
||||
except ValueError as e:
|
||||
except (AttributeError, ValueError):
|
||||
return 1
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user