Skip to content

Commit 19dd907

Browse files
committed
Switch to built-in text encoding helper of subprocess to avoid new additions
of `force_X` unless needed.
1 parent f3d14ee commit 19dd907

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mig/shared/resadm.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838

3939
# MiG imports
4040

41-
from mig.shared.base import force_native_str
4241
from mig.shared.conf import get_resource_configuration, get_resource_exe, \
4342
get_resource_store, get_configuration_object
4443
from mig.shared.fileio import unpickle, pickle
@@ -600,8 +599,8 @@ def check_mounted(target, logger):
600599
if os.path.ismount(target):
601600
return True
602601
mount_line = ' on %s type fuse.sshfs ' % target
603-
# NOTE: we need output on str format for find below
604-
mount_out = force_native_str(subprocess_check_output(['mount']))
602+
# NOTE: we want utf8-encoded output as text str for find below
603+
mount_out = subprocess_check_output(['mount'], text=True)
605604
logger.debug("check_mounted out: %s vs %s" % (mount_out, mount_line))
606605
return (mount_out.find(mount_line) != -1)
607606

0 commit comments

Comments
 (0)