Use "is not None" instead of wrong test "not ... is None"