Skip to content

Commit

Permalink
Merge branch 'missing_os_sysconf' of https://github.com/marcus-h/osc
Browse files Browse the repository at this point in the history
Handle missing os.sysconf more gracefully.
  • Loading branch information
marcus-h committed Sep 13, 2021
2 parents a7bdd67 + 0285986 commit 5fdcecf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@
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


Expand Down

0 comments on commit 5fdcecf

Please sign in to comment.