fixed py2.7/3 differences in long type handling in pairing module