Skip to content

Commit

Permalink
CA-388527: Keep python2 and python3 compatibility
Browse files Browse the repository at this point in the history
The PR xapi-project#42
uses keyword-only argument which is not supported in Python2
In XS8, we still uses python2, so fix this to work both in python2
and python3

Signed-off-by: Stephen Cheng <[email protected]>
  • Loading branch information
stephenchengCloud committed Jun 7, 2024
1 parent dd20739 commit 4fde708
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions XSConsoleDialogueBases.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,13 +634,13 @@ def HandleSRChoice(self, inChoice):
self.DoAction(self.choices[inChoice].sr)

class ProgressDialogue(Dialogue):
def __init__(self, inTask, inText, *args, OnComplete=None):
def __init__(self, inTask, inText, *args, **kwargs):
Dialogue.__init__(self)
self.task = inTask
self.text = inText
# OnComplete is a function to call when the task completes
# Used for getting task result and do something after the task completes
self.OnComplete = OnComplete
self.OnComplete = kwargs.get('OnComplete', None)
self.args = args # Arguments to pass to OnComplete

self.ChangeState('INITIAL')
Expand Down

0 comments on commit 4fde708

Please sign in to comment.