iamjarret / pystockfish

Implements an easy-to-use Engine class to integrates the Stockfish chess engine with Python
GNU General Public License v3.0
30 stars 13 forks source link

IndexError: winning move has no ponder #11

Closed L0laapk3 closed 8 years ago

L0laapk3 commented 8 years ago

in def bestmove:

i suggest the following fix:

instead of

                 return {'move': split_text[1],
                        'ponder': split_text[3],
                        'info': last_line
                }

use:

            try:
                return {'move': split_text[1],
                        'ponder': split_text[3],
                        'info': last_line
                }
            except IndexError:
                return {'move': split_text[1],
                        'ponder': '-',
                        'info': last_line
                }
iamjarret commented 8 years ago

Thanks for pointing this out, L0laapk3. I added a fix in 7678a025c5 with an if clause.