Simply is_s390 by using bool instead of if statement. Add a docstring to the function and remove space from shebang while we're at it.
Signed-off-by: John Kacur jkacur@redhat.com --- procfs/procfs.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/procfs/procfs.py b/procfs/procfs.py index 14135ac72cc2..59f8a2dfeb0a 100755 --- a/procfs/procfs.py +++ b/procfs/procfs.py @@ -1,4 +1,4 @@ -#! /usr/bin/python3 +#!/usr/bin/python3 # -*- python -*- # -*- coding: utf-8 -*- # @@ -30,11 +30,9 @@ VERSION = "0.5"
def is_s390(): + """ Return True if running on s390 or s390x """ machine = platform.machine() - if re.search('s390', machine): - return True - else: - return False + return bool(re.search('s390', machine))
def process_cmdline(pid_info):