Skip to content

Commit 5953295

Browse files
authored
fix(redundant logic in jobs list) (#159)
You don't need to check the length as if the len == 0 it will return False auto-magically.
1 parent 6eb5c26 commit 5953295

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

examples/jobs_list.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def display(job_dict):
4646
a = pyslurm.job()
4747
jobs = a.get()
4848

49-
if len(jobs) > 0:
49+
if jobs:
5050

5151
display(jobs)
5252

@@ -66,7 +66,6 @@ def display(job_dict):
6666
print("JobIDs in Pending state - {0}".format(pending))
6767
print()
6868
else:
69-
7069
print("No jobs found !")
7170
except ValueError as e:
7271
print("Job query failed - {0}".format(e.args[0]))

0 commit comments

Comments
 (0)