<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __deserialize_primitive(self, payload, obj_type):
 # type: (str, Union[T, str]) -> Any """Deserialize primitive datatypes. :param payload: data to be deserialized :type payload: str :param obj_type: primitive datatype str :type obj_type: Union[object, str] :return: deserialized primitive datatype object :rtype: object :raises: :py:class:`ask_sdk_core.exceptions.SerializationException` """

        obj_cast = cast(Any, obj_type)
        try:
            return obj_cast(payload)
        except UnicodeEncodeError:
            return unicode_type(payload)
        except TypeError:
            return payload
        except ValueError:
            raise SerializationException(
                "Failed to parse {} into '{}' object".format(
                    payload, obj_cast.__name__))