1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-06 07:33:39 +02:00

Merge branch 'missing_os_sysconf' of https://github.com/marcus-h/osc

Handle missing os.sysconf more gracefully.
This commit is contained in:
Marcus Huewe
2021-09-13 14:39:04 +02:00

View File

@@ -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