Fix generator for pypy (#4198)

This commit is contained in:
Dingyuan Wang 2023-09-12 14:28:14 +08:00 committed by GitHub
parent 2cef715921
commit 5ba312555a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,7 +197,7 @@ def _write_class_init(tlobject, kind, type_constructors, builder):
if not tlobject.real_args: if not tlobject.real_args:
return return
if any(a.name in __builtins__ for a in tlobject.real_args): if any(hasattr(__builtins__, a.name) for a in tlobject.real_args):
builder.writeln('# noinspection PyShadowingBuiltins') builder.writeln('# noinspection PyShadowingBuiltins')
builder.writeln("def __init__({}):", ', '.join(['self'] + args)) builder.writeln("def __init__({}):", ', '.join(['self'] + args))