memlimit: python3 compatibility