Skip to content

Commit bb6229b

Browse files
committed
python: allow JobID to take a JobID
Problem: The JobID class allows users to pass in a jobid in many forms. However, it does not allow JobID to be initialized via another JobID object, in the event that is what the user passed in. Allow JobID to take a JobID for initialization.
1 parent 434fdf6 commit bb6229b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/bindings/python/flux/job/JobID.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ class JobID(int):
5353
"""
5454

5555
def __new__(cls, value):
56+
if isinstance(value, JobID):
57+
return cls(value.orig_str)
5658
if isinstance(value, int):
5759
jobid = value
5860
else:

0 commit comments

Comments
 (0)