opam: Only capture stdout when calling 'opam list'

Ensure opam errors are displayed when attempting to list all packages
in order to ease debugging.

Related to swh/infra/sysadm-environment#4971.
This commit is contained in:
Antoine Lambert 2023-06-29 17:41:06 +02:00
parent d20803ddae
commit 01be6ce581

View file

@ -6,7 +6,7 @@
import logging
import os
import shutil
from subprocess import run
from subprocess import PIPE, run
from typing import Any, Dict, Iterator, Optional
from swh.lister.pattern import StatelessLister
@ -97,7 +97,7 @@ class OpamLister(StatelessLister[PageType]):
"--short",
],
env=self.env,
capture_output=True,
stdout=PIPE,
text=True,
check=True,
)