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:
parent
f4d68b8860
commit
d0a062ffa3
1 changed files with 2 additions and 2 deletions
|
@ -138,9 +138,9 @@ class Connection(ConnectionBase):
|
||||||
return protocol
|
return protocol
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
err_msg = to_unicode(e).strip()
|
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')
|
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:
|
if m:
|
||||||
code = int(m.groups()[0])
|
code = int(m.groups()[0])
|
||||||
if code == 401:
|
if code == 401:
|
||||||
|
|
Loading…
Reference in a new issue