Skip to content

Commit

Permalink
fix py2 error when importing DEVNULL
Browse files Browse the repository at this point in the history
Signed-off-by: Xiangce Liu <[email protected]>
  • Loading branch information
xiangce committed Aug 13, 2024
1 parent 3a36135 commit 406125a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion insights/util/subproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
import six
import sys

from subprocess import Popen, PIPE, STDOUT, DEVNULL
from subprocess import Popen, PIPE, STDOUT

from insights.core.exceptions import CalledProcessError
from insights.util import which

try:
from subprocess import DEVNULL
except:
DEVNULL = open(os.devnull, 'w')

log = logging.getLogger(__name__)


Expand Down

0 comments on commit 406125a

Please sign in to comment.