Fix retryloop for py3.