From f50ff4143a6ddf4429cde251e38c3663af03c08e Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Fri, 20 Mar 2020 14:48:55 +0000
Subject: [PATCH] BF: fixes to info function

---
 fsl/utils/fslsub.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fsl/utils/fslsub.py b/fsl/utils/fslsub.py
index 2037a87a9..46bc0466d 100644
--- a/fsl/utils/fslsub.py
+++ b/fsl/utils/fslsub.py
@@ -40,8 +40,7 @@ Example usage, building a short pipeline::
 """
 
 
-from six import string_types, BytesIO
-import subprocess as sp
+from six import BytesIO
 import os.path as op
 import glob
 import time
@@ -149,8 +148,9 @@ def info(job_id):
     :return:     dictionary with information on the submitted job (empty
                  if job does not exist)
     """
+    from fsl.utils.run import run
     try:
-        result = sp.call(['qstat', '-j', job_id]).decode('utf-8')
+        result = run(['qstat', '-j', job_id])
     except FileNotFoundError:
         log.debug("qstat not found; assuming not on cluster")
         return {}
@@ -158,7 +158,7 @@ def info(job_id):
         return {}
     res = {}
     for line in result.splitlines()[1:]:
-        key, value = line.split(':', nsplit=1)
+        key, value = line.split(':', 1)
         res[key.strip()] = value.strip()
     return res
 
-- 
GitLab