      Deserialize a stream or string of YAML data.
      """
      if isinstance(stream_or_string, bytes):
          stream_or_string = stream_or_string.decode('utf-8')
      if isinstance(stream_or_string, six.string_types):
          stream = StringIO(stream_or_string)
      else:
          stream = stream_or_string
      try:
          for obj in PythonDeserializer(yaml.load(stream, Loader=SafeLoader), **options):
 
</s> remove     if not isinstance(stream_or_string, (bytes, six.string_types)):
 </s> add     if not isinstance(stream_or_string, (bytes, str)): </s> remove         if isinstance(stream_or_string, six.string_types):
 </s> add         if isinstance(stream_or_string, str): </s> remove                 s = six.text_type(s, encoding, errors)
 </s> add                 s = str(s, encoding, errors) </s> remove         if not issubclass(type(s), six.string_types):
 </s> add         if not issubclass(type(s), str): </s> remove             addresses = [[six.text_type(address) for address in obj.addresses.all()] for obj in qs]
        self.assertEqual(addresses, [[six.text_type(self.author_address)], [], []])
 </s> add             addresses = [[str(address) for address in obj.addresses.all()] for obj in qs]
        self.assertEqual(addresses, [[str(self.author_address)], [], []])
    if isinstance(stream_or_string, str):
      Deserialize a stream or string of YAML data.
      """
      if isinstance(stream_or_string, bytes):
          stream_or_string = stream_or_string.decode('utf-8')
    if isinstance(stream_or_string, str):
          stream = StringIO(stream_or_string)
      else:
          stream = stream_or_string
      try:
          for obj in PythonDeserializer(yaml.load(stream, Loader=SafeLoader), **options):
keep keep keep keep replace keep keep keep keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/core/serializers/pyyaml.py