fix none type check python3