未验证 提交 2dcb0ebf 编写于 作者: N Nyakku Shigure 提交者: GitHub

[Dy2St] skip compare between func and module attribute to fix NumPy 1.25 error (#55482)

上级 26fba07c
...@@ -119,10 +119,9 @@ def is_unsupported(func): ...@@ -119,10 +119,9 @@ def is_unsupported(func):
for m in BUILTIN_LIKELY_MODULES: for m in BUILTIN_LIKELY_MODULES:
for v in m.__dict__.values(): for v in m.__dict__.values():
func_in_dict = func == v if not callable(v):
if isinstance(func_in_dict, (list, numpy.ndarray)): continue
func_in_dict = numpy.array(func_in_dict).any() if func is v:
if func_in_dict:
translator_logger.log( translator_logger.log(
2, 2,
"Whitelist: {} is part of built-in module and does not have to be transformed.".format( "Whitelist: {} is part of built-in module and does not have to be transformed.".format(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册