mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 05:45:27 +00:00
Simpler definition of a custom exception class
This commit is contained in:
parent
8c4a84c5de
commit
566407d6f6
|
@ -28,11 +28,9 @@ import sys
|
||||||
|
|
||||||
class InputFormatError(Exception):
|
class InputFormatError(Exception):
|
||||||
def __init__(self, filename, line_number, message, *args, **kwargs):
|
def __init__(self, filename, line_number, message, *args, **kwargs):
|
||||||
self.filename = filename
|
message = '{}:{}: {}'.format(filename, line_number,
|
||||||
self.line_number = line_number
|
message.format(*args, **kwargs))
|
||||||
self.message = message.format(*args, **kwargs)
|
super().__init__(message)
|
||||||
def __str__(self):
|
|
||||||
return '{}:{}: {}'.format(self.filename, self.line_number, self.message)
|
|
||||||
|
|
||||||
STANDARD_SECTIONS = (
|
STANDARD_SECTIONS = (
|
||||||
b'Interface changes',
|
b'Interface changes',
|
||||||
|
|
Loading…
Reference in a new issue