hgwebfs: simplify retry loop construction

This commit is contained in:
cinap_lenrek 2017-10-04 05:06:54 +02:00
parent b12763136e
commit d5576d8473

View file

@ -6,11 +6,10 @@ import os
class Webconn: class Webconn:
def __init__(self, mnt, req): def __init__(self, mnt, req):
loop = True while True:
while loop:
loop = False
try: try:
self.open(mnt, req) self.open(mnt, req)
return
except IOError, e: except IOError, e:
try: try:
errstr = e.strerror errstr = e.strerror
@ -19,7 +18,6 @@ class Webconn:
raise e raise e
if os.spawnl(os.P_WAIT, "/boot/factotum", "getkey", "-g", params) != 0: if os.spawnl(os.P_WAIT, "/boot/factotum", "getkey", "-g", params) != 0:
raise e raise e
loop = True
except: except:
raise e raise e