fix flake8-bugbear B011
B011 Do not call assert False since python -O removes these calls. Instead callers should raise AssertionError().
This commit is contained in:
@@ -709,7 +709,7 @@ class HistoryList(MyTreeView, AcceptFileDragDrop):
|
|||||||
if value is not None:
|
if value is not None:
|
||||||
self.hm.update_fiat(index)
|
self.hm.update_fiat(index)
|
||||||
else:
|
else:
|
||||||
assert False
|
raise Exception(f"did not expect {column=!r} to get edited")
|
||||||
|
|
||||||
def on_double_click(self, idx):
|
def on_double_click(self, idx):
|
||||||
tx_item = idx.internalPointer().get_data()
|
tx_item = idx.internalPointer().get_data()
|
||||||
|
|||||||
@@ -1362,7 +1362,7 @@ class Network(Logger, NetworkRetryManager[ServerAddr]):
|
|||||||
async with session.post(url, json=json, headers=headers) as resp:
|
async with session.post(url, json=json, headers=headers) as resp:
|
||||||
return await on_finish(resp)
|
return await on_finish(resp)
|
||||||
else:
|
else:
|
||||||
assert False
|
raise Exception(f"unexpected {method=!r}")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def send_http_on_proxy(cls, method, url, **kwargs):
|
def send_http_on_proxy(cls, method, url, **kwargs):
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ class TrustedCoinCosignerClient(Logger):
|
|||||||
on_finish=self.handle_response,
|
on_finish=self.handle_response,
|
||||||
timeout=timeout)
|
timeout=timeout)
|
||||||
else:
|
else:
|
||||||
assert False
|
raise Exception(f"unexpected {method=!r}")
|
||||||
except TrustedCoinException:
|
except TrustedCoinException:
|
||||||
raise
|
raise
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user