diff options
author | John Kacur <jkacur@redhat.com> | 2020-11-06 13:41:14 -0500 |
---|---|---|
committer | John Kacur <jkacur@redhat.com> | 2020-11-06 13:43:36 -0500 |
commit | f722714109845c29435ddfe532829ae78ba31a63 (patch) | |
tree | de771880f3c7e05e4698a3287e5431427b35cea2 | |
parent | 5bdc3d88d9f7ee1f572dd21b67a6131c7d54aea3 (diff) | |
download | python-linux-procfs-f722714109845c29435ddfe532829ae78ba31a63.tar.gz |
python-linux-procfs: procfs.py: Simplify is_s390
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>
-rwxr-xr-x | procfs/procfs.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/procfs/procfs.py b/procfs/procfs.py index 14135ac..59f8a2d 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): |