self.units = int(units) if not isinstance(units, int) else units TypeError: int() argument must be a string, a bytes-like object or a number, not 'tuple'
时间: 2023-10-24 17:07:53 浏览: 135
这个错误提示是因为你传入的 `units` 参数是一个元组(tuple),而 `int()` 函数只能接受字符串、字节串或数字作为参数,无法处理元组。你需要检查一下代码,看看是不是在调用这个函数的时候,把一个元组传给了 `units` 参数,导致出现了这个错误。如果是的话,你需要把元组转换成一个字符串、字节串或数字,再传给 `units` 参数。具体的转换方法要根据你的代码和数据结构来确定,你可以查阅相关文档或参考其他的代码实现。
阅读全文
相关推荐









