mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-11-14 21:10:40 +00:00
Apply several lints
This commit is contained in:
@@ -27,7 +27,7 @@ def generate_errors(errors, f):
|
||||
# Error classes generation
|
||||
for error in errors:
|
||||
f.write('\n\nclass {}({}):\n'
|
||||
' def __init__(self, request, **kwargs):\n'
|
||||
' def __init__(self, **kwargs):\n'
|
||||
' '.format(error.name, error.subclass))
|
||||
|
||||
if error.has_captures:
|
||||
@@ -40,7 +40,7 @@ def generate_errors(errors, f):
|
||||
if error.has_captures:
|
||||
f.write('.format({0}=self.{0})'.format(error.capture_name))
|
||||
|
||||
f.write(' + self._fmt_request(request))\n')
|
||||
f.write(" + self._fmt_request(kwargs['request']))\n")
|
||||
|
||||
# Create the actual {CODE: ErrorClassName} dict once classes are defined
|
||||
f.write('\n\nrpc_errors_dict = {\n')
|
||||
|
||||
@@ -206,6 +206,9 @@ def _write_class_init(tlobject, kind, type_constructors, builder):
|
||||
if not tlobject.real_args:
|
||||
return
|
||||
|
||||
if any(a.name in __builtins__ for a in tlobject.real_args):
|
||||
builder.writeln('# noinspection PyShadowingBuiltins')
|
||||
|
||||
builder.writeln("def __init__({}):", ', '.join(['self'] + args))
|
||||
builder.writeln('"""')
|
||||
if tlobject.is_function:
|
||||
|
||||
Reference in New Issue
Block a user