fix recursion in python driver when reconnecting due to keyboard interrupt