mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-10-31 16:07:44 +03:00 
			
		
		
		
	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:
		
							parent
							
								
									08b9d7c4ef
								
							
						
					
					
						commit
						55bcc29ae0
					
				|  | @ -4,7 +4,7 @@ | |||
| class ReadCancelledError(Exception): | ||||
|     """Occurs when a read operation was cancelled.""" | ||||
|     def __init__(self): | ||||
|         super().__init__(self, 'The read operation was cancelled.') | ||||
|         super().__init__('The read operation was cancelled.') | ||||
| 
 | ||||
| 
 | ||||
| class TypeNotFoundError(Exception): | ||||
|  | @ -14,7 +14,7 @@ class TypeNotFoundError(Exception): | |||
|     """ | ||||
|     def __init__(self, invalid_constructor_id): | ||||
|         super().__init__( | ||||
|             self, 'Could not find a matching Constructor ID for the TLObject ' | ||||
|             'Could not find a matching Constructor ID for the TLObject ' | ||||
|             'that was supposed to be read with ID {}. Most likely, a TLObject ' | ||||
|             'was trying to be read when it should not be read.' | ||||
|             .format(hex(invalid_constructor_id))) | ||||
|  | @ -29,7 +29,6 @@ class InvalidChecksumError(Exception): | |||
|     """ | ||||
|     def __init__(self, checksum, valid_checksum): | ||||
|         super().__init__( | ||||
|             self, | ||||
|             'Invalid checksum ({} when {} was expected). ' | ||||
|             'This packet should be skipped.' | ||||
|             .format(checksum, valid_checksum)) | ||||
|  | @ -44,7 +43,6 @@ class BrokenAuthKeyError(Exception): | |||
|     """ | ||||
|     def __init__(self): | ||||
|         super().__init__( | ||||
|             self, | ||||
|             'The authorization key is broken, and it must be reset.' | ||||
|         ) | ||||
| 
 | ||||
|  | @ -56,7 +54,7 @@ class SecurityError(Exception): | |||
|     def __init__(self, *args): | ||||
|         if not args: | ||||
|             args = ['A security check failed.'] | ||||
|         super().__init__(self, *args) | ||||
|         super().__init__(*args) | ||||
| 
 | ||||
| 
 | ||||
| class CdnFileTamperedError(SecurityError): | ||||
|  |  | |||
|  | @ -40,7 +40,7 @@ class ForbiddenError(RPCError): | |||
|     message = 'FORBIDDEN' | ||||
| 
 | ||||
|     def __init__(self, message): | ||||
|         super().__init__(self, message) | ||||
|         super().__init__(message) | ||||
|         self.message = message | ||||
| 
 | ||||
| 
 | ||||
|  | @ -52,7 +52,7 @@ class NotFoundError(RPCError): | |||
|     message = 'NOT_FOUND' | ||||
| 
 | ||||
|     def __init__(self, message): | ||||
|         super().__init__(self, message) | ||||
|         super().__init__(message) | ||||
|         self.message = message | ||||
| 
 | ||||
| 
 | ||||
|  | @ -77,7 +77,7 @@ class ServerError(RPCError): | |||
|     message = 'INTERNAL' | ||||
| 
 | ||||
|     def __init__(self, message): | ||||
|         super().__init__(self, message) | ||||
|         super().__init__(message) | ||||
|         self.message = message | ||||
| 
 | ||||
| 
 | ||||
|  | @ -121,7 +121,7 @@ class BadMessageError(Exception): | |||
|     } | ||||
| 
 | ||||
|     def __init__(self, code): | ||||
|         super().__init__(self, self.ErrorMessages.get( | ||||
|         super().__init__(self.ErrorMessages.get( | ||||
|             code, | ||||
|             'Unknown error code (this should not happen): {}.'.format(code))) | ||||
| 
 | ||||
|  |  | |||
|  | @ -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') | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user