Errors: Fix passing 'self' to the constructors of the superclasses

This is necessary only if the superclass name is specified explicitly instead of super() call.
This commit is contained in:
Dmitry D. Chernov
2018-02-14 17:09:22 +10:00
parent 08b9d7c4ef
commit 55bcc29ae0
3 changed files with 8 additions and 10 deletions

View File

@@ -68,7 +68,7 @@ def write_error(f, code, name, desc, capture_name):
f.write(
"self.{} = int(kwargs.get('capture', 0))\n ".format(capture_name)
)
f.write('super(Exception, self).__init__(self, {}'.format(repr(desc)))
f.write('super(Exception, self).__init__({}'.format(repr(desc)))
if capture_name:
f.write('.format(self.{})'.format(capture_name))
f.write(')\n')