python3: don't depend on NoneType