long is gone in Py3, use six.integer_types