hush more lgtm.com -discovered static-analysis problems
This commit is contained in:
parent
443c402f60
commit
624072c111
|
@ -164,6 +164,7 @@ class Receiver:
|
||||||
recognized = True
|
recognized = True
|
||||||
if not want_offer:
|
if not want_offer:
|
||||||
raise TransferError("duplicate offer")
|
raise TransferError("duplicate offer")
|
||||||
|
want_offer = False
|
||||||
try:
|
try:
|
||||||
yield self._parse_offer(them_d[u"offer"], w)
|
yield self._parse_offer(them_d[u"offer"], w)
|
||||||
except RespondError as r:
|
except RespondError as r:
|
||||||
|
|
|
@ -56,8 +56,9 @@ def find_addresses():
|
||||||
|
|
||||||
def _query(path, args, regex):
|
def _query(path, args, regex):
|
||||||
env = {'LANG': 'en_US.UTF-8'}
|
env = {'LANG': 'en_US.UTF-8'}
|
||||||
TRIES = 5
|
trial = 0
|
||||||
for trial in range(TRIES):
|
while True:
|
||||||
|
trial += 1
|
||||||
try:
|
try:
|
||||||
p = subprocess.Popen([path] + list(args),
|
p = subprocess.Popen([path] + list(args),
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
|
@ -67,7 +68,7 @@ def _query(path, args, regex):
|
||||||
(output, err) = p.communicate()
|
(output, err) = p.communicate()
|
||||||
break
|
break
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == errno.EINTR and trial < TRIES-1:
|
if e.errno == errno.EINTR and trial < 5:
|
||||||
continue
|
continue
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user