Menu

#48 Three Shuffles and a Draw: Exception in Tkinter callback

v1.0 (example)
closed
nobody
None
5
2022-07-16
2022-07-04
Jason
No
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.10/tkinter/__init__.py", line 1921, in __call__
    return self.func(*args)
  File "/usr/lib/python3.10/site-packages/pysollib/actions.py", line 484, in mDeal
    self.game.dealCards()
  File "/usr/lib/python3.10/site-packages/pysollib/game/__init__.py", line 1929, in dealCards
    self.finishMove()
  File "/usr/lib/python3.10/site-packages/pysollib/game/__init__.py", line 3003, in finishMove
    a1.cmpForRedo(a2) != 0:
  File "/usr/lib/python3.10/site-packages/pysollib/move.py", line 476, in cmpForRedo
    cmp(self.state, other.state))
  File "/usr/lib/python3.10/site-packages/pysollib/move.py", line 28, in cmp
    return ((b > a)-(a > b))
TypeError: '>' not supported between instances of 'method' and 'method'

Minimal steps to reproduce:

  • Draw, skip Round 1 and go straight to Round 2 (or any round after the first)
  • Play at least 1 card of any valid play
  • Undo all valid plays during this Round 2 (keyboard hotkey "z")
  • Undo 1 more time to go back to the previous round
  • Draw, skip to next round again (keyboard hotkey "d" or spacebar)
  • You should see the error above in the terminal

Discussion

  • Joe R.

    Joe R. - 2022-07-16

    Fixed. This was an error with the way it handles for redoing of redeal moves. Don't know why this logic only triggers after using the draw, but it was making a bad comparison, which I fixed.

     
  • Joe R.

    Joe R. - 2022-07-16
    • status: open --> closed
     

Log in to post a comment.