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 #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 authored and rosslagerwall committed Jun 18, 2024
1 parent a8d0715 commit a4b346c
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 @@ -628,13 +628,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 a4b346c

Please sign in to comment.