Use basestr instead of str in YAML parser