diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 582aa35e3b..0995fdd758 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -73,6 +73,22 @@ try: except ImportError: imap = map # Python 3 +try: + basestring +except NameError: + basestring = str # Python 3 + +try: + unicode +except NameError: + unicode = str # Python 3 + +try: + bytes +except NameError: + bytes = str # Python 2 + + try: import json # Detect the python-json library which is incompatible