mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
avoid new SyntaxWarning in python 3.14
this change should not alter behavior; the code was already correct prevents the following message on stdout during startup: SyntaxWarning: 'return' in a 'finally' block
This commit is contained in:
parent
c599e2aaa3
commit
5ac3864874
|
@ -2716,6 +2716,7 @@ class HttpCli(object):
|
||||||
locked = chashes # remaining chunks to be received in this request
|
locked = chashes # remaining chunks to be received in this request
|
||||||
written = [] # chunks written to disk, but not yet released by up2k
|
written = [] # chunks written to disk, but not yet released by up2k
|
||||||
num_left = -1 # num chunks left according to most recent up2k release
|
num_left = -1 # num chunks left according to most recent up2k release
|
||||||
|
bail1 = False # used in sad path to avoid contradicting error-text
|
||||||
treport = time.time() # ratelimit up2k reporting to reduce overhead
|
treport = time.time() # ratelimit up2k reporting to reduce overhead
|
||||||
|
|
||||||
if "x-up2k-subc" in self.headers:
|
if "x-up2k-subc" in self.headers:
|
||||||
|
@ -2854,7 +2855,6 @@ class HttpCli(object):
|
||||||
except:
|
except:
|
||||||
# maybe busted handle (eg. disk went full)
|
# maybe busted handle (eg. disk went full)
|
||||||
f.close()
|
f.close()
|
||||||
chashes = [] # exception flag
|
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
if locked:
|
if locked:
|
||||||
|
@ -2863,13 +2863,14 @@ class HttpCli(object):
|
||||||
num_left, t = x.get()
|
num_left, t = x.get()
|
||||||
if num_left < 0:
|
if num_left < 0:
|
||||||
self.loud_reply(t, status=500)
|
self.loud_reply(t, status=500)
|
||||||
if chashes: # kills exception bubbling otherwise
|
bail1 = True
|
||||||
return False
|
|
||||||
else:
|
else:
|
||||||
t = "got %d more chunks, %d left"
|
t = "got %d more chunks, %d left"
|
||||||
self.log(t % (len(written), num_left), 6)
|
self.log(t % (len(written), num_left), 6)
|
||||||
|
|
||||||
if num_left < 0:
|
if num_left < 0:
|
||||||
|
if bail1:
|
||||||
|
return False
|
||||||
raise Pebkac(500, "unconfirmed; see serverlog")
|
raise Pebkac(500, "unconfirmed; see serverlog")
|
||||||
|
|
||||||
if not num_left and fpool:
|
if not num_left and fpool:
|
||||||
|
|
Loading…
Reference in a new issue