Python 3 doesn't have a long type any longer. You should probably special-case Python 2 here (same remark for the test).