diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 33291e3610..b3b2a8cd81 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -66,7 +66,12 @@ import grp import pwd import platform import errno -from itertools import imap, repeat +from itertools import repeat + +try: + from itertools import imap # Python 2 +except ImportError: + imap = map # Python 3 try: import json