BF: make integer tests safe for python 2

Longs can appear in place of integers, especially on Windows.  Use compatible
test for (int, long) or (int,) depending on python version.