Add compatibility for py3 to pynipap