ruff FURB192 (prefer max over sorted()[-1])
This commit is contained in:
parent
d8dd0cc246
commit
80313dbf0b
2 changed files with 3 additions and 3 deletions
|
|
@ -115,11 +115,12 @@ class OpResubmit(OpSubmit):
|
|||
die(1, '--autosign is required for this operation')
|
||||
|
||||
def get_tx(self):
|
||||
def keyfunc(x):
|
||||
return getattr(x.data, 'submit_time', None) or x.data.create_time
|
||||
from ...autosign.signable import Signable
|
||||
fns = Signable.xmr_transaction(self.asi).get_submitted()
|
||||
cls = self.get_tx_cls('Submitted')
|
||||
return sorted((cls(self.cfg, Path(fn)) for fn in fns),
|
||||
key = lambda x: getattr(x.data, 'submit_time', None) or x.data.create_time)[-1]
|
||||
return max((cls(self.cfg, Path(fn)) for fn in fns), key=keyfunc)
|
||||
|
||||
class OpAbort(OpBase):
|
||||
opts = ('watch_only', 'autosign')
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ ignore = [
|
|||
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged
|
||||
"BLE001", # Do not catch blind exception: `Exception`
|
||||
"E722", # bare except
|
||||
"FURB192", # Prefer `max` over `sorted()` to compute the maximum value in a sequence
|
||||
"I001", # Import block is un-sorted or un-formatted
|
||||
"ISC004", # Unparenthesized implicit string concatenation in collection
|
||||
"N999", # Invalid module name: 'import'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue