Migrate basestring to a python3 compatible type (#17199)

This commit is contained in:
Toshio Kuratomi 2016-08-23 13:13:44 -07:00 committed by GitHub
parent a695e18615
commit a22909c226
28 changed files with 137 additions and 101 deletions

View file

@ -24,10 +24,12 @@ __metaclass__ = type
import os
import sys
import ast
from ansible.parsing.yaml.loader import AnsibleLoader
import traceback
from collections import MutableMapping, MutableSet, MutableSequence
from ansible.compat.six import string_types
from ansible.parsing.yaml.loader import AnsibleLoader
from ansible.plugins import fragment_loader
try:
@ -76,7 +78,7 @@ def get_docstring(filename, verbose=False):
doc = AnsibleLoader(child.value.s, file_name=filename).get_single_data()
fragments = doc.get('extends_documentation_fragment', [])
if isinstance(fragments, basestring):
if isinstance(fragments, string_types):
fragments = [ fragments ]
# Allow the module to specify a var other than DOCUMENTATION