[tor-commits] [stem/master] Use isinstance for type checks