From 2c4982b58d0dd2660196d96ce81fc845e7c2ba20 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Wed, 23 Sep 2015 09:59:59 +0300 Subject: [PATCH] Python 3: there's no itertools.imap Because the builtin map() acts like an iterator already. --- lib/ansible/module_utils/basic.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 33291e36106..b3b2a8cd81a 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