Skip to content

Commit

Permalink
Use os.waitstatus_to_exitcode to make code more readable
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
  • Loading branch information
akhuettel committed Sep 2, 2023
1 parent 2da4a50 commit 3133f93
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/portage/dbapi/bintree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,9 +1237,8 @@ def _populate_local(self, reindex=True):
def _run_trust_helper(self):
portage_trust_helper = self.settings.get("PORTAGE_TRUST_HELPER", "true")
# getuto is a shell script...
ret = os.system(portage_trust_helper)
if ret == 32512:
# lsb 0 (no error in shell process), msb 127 (command not found)
ret = os.waitstatus_to_exitcode(os.system(portage_trust_helper))
if ret == 127:
raise OSError(
_(
"Did not find trust helper. Install app-portage/getuto or set PORTAGE_TRUST_HELPER=true"
Expand Down

0 comments on commit 3133f93

Please sign in to comment.