summaryrefslogtreecommitdiffstats
path: root/cmd/arc_summary/arc_summary3
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/arc_summary/arc_summary3')
-rwxr-xr-xcmd/arc_summary/arc_summary314
1 files changed, 3 insertions, 11 deletions
diff --git a/cmd/arc_summary/arc_summary3 b/cmd/arc_summary/arc_summary3
index 301c485b3..9d0c2d30d 100755
--- a/cmd/arc_summary/arc_summary3
+++ b/cmd/arc_summary/arc_summary3
@@ -191,21 +191,13 @@ elif sys.platform.startswith('linux'):
# there, so we fall back on modinfo
command = ["/sbin/modinfo", request, "-0"]
- # The recommended way to do this is with subprocess.run(). However,
- # some installed versions of Python are < 3.5, so we offer them
- # the option of doing it the old way (for now)
info = ''
try:
- if 'run' in dir(subprocess):
- info = subprocess.run(command, stdout=subprocess.PIPE,
- universal_newlines=True)
- raw_output = info.stdout.split('\0')
- else:
- info = subprocess.check_output(command,
- universal_newlines=True)
- raw_output = info.split('\0')
+ info = subprocess.run(command, stdout=subprocess.PIPE,
+ check=True, universal_newlines=True)
+ raw_output = info.stdout.split('\0')
except subprocess.CalledProcessError:
print("Error: Descriptions not available",