完成 Ruff 全量清理
This commit is contained in:
@@ -211,7 +211,7 @@ class WupResponse:
|
||||
_, vt = ins.read_head()
|
||||
val = _read_bytes_value(ins, vt)
|
||||
self.newdata[key] = val
|
||||
except Exception as e:
|
||||
except Exception as e: # noqa: BLE001 外部接口与任务边界需要保留宽泛异常兜底
|
||||
print(f"[WupResponse] 解析 newdata 失败: {e}")
|
||||
|
||||
def readStruct(self, key: str, struct_class=None):
|
||||
@@ -236,13 +236,13 @@ class WupResponse:
|
||||
ins = TafInputStream(data)
|
||||
# newdata 里的结构体以 STRUCT_BEGIN 开头
|
||||
try:
|
||||
tag, dtype = ins.peek_head()
|
||||
_tag, dtype = ins.peek_head()
|
||||
if dtype == TafType.STRUCT_BEGIN:
|
||||
ins.read_head() # 消费 STRUCT_BEGIN
|
||||
obj = struct_class()
|
||||
obj.read_from(ins)
|
||||
return obj
|
||||
except Exception as e:
|
||||
except Exception as e: # noqa: BLE001 外部接口与任务边界需要保留宽泛异常兜底
|
||||
print(f"[WupResponse] 解析 {struct_class.__name__} 失败: {e}")
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user