1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

python3 doesn't have raw explicit-unicode literals. Workaround it with a raw native string that we make unicode in py2.

This commit is contained in:
Toshio Kuratomi 2016-01-25 19:46:57 -08:00
parent f4d68b8860
commit d0a062ffa3

View file

@ -138,9 +138,9 @@ class Connection(ConnectionBase):
return protocol
except Exception as e:
err_msg = to_unicode(e).strip()
if re.search(ur'Operation\s+?timed\s+?out', err_msg, re.I):
if re.search(to_unicode(r'Operation\s+?timed\s+?out'), err_msg, re.I):
raise AnsibleError('the connection attempt timed out')
m = re.search(ur'Code\s+?(\d{3})', err_msg)
m = re.search(to_unicode(r'Code\s+?(\d{3})'), err_msg)
if m:
code = int(m.groups()[0])
if code == 401: