Check that the type in Colour and Permissions are int.
This commit is contained in:
parent
b7488d7c6e
commit
702d596af9
@ -53,6 +53,9 @@ class Colour:
|
|||||||
__slots__ = ('value',)
|
__slots__ = ('value',)
|
||||||
|
|
||||||
def __init__(self, value):
|
def __init__(self, value):
|
||||||
|
if not isinstance(value, int):
|
||||||
|
raise TypeError('Expected int parameter, received %s instead.' % value.__class__.__name__)
|
||||||
|
|
||||||
self.value = value
|
self.value = value
|
||||||
|
|
||||||
def _get_byte(self, byte):
|
def _get_byte(self, byte):
|
||||||
|
@ -69,6 +69,9 @@ class Permissions:
|
|||||||
|
|
||||||
__slots__ = ('value',)
|
__slots__ = ('value',)
|
||||||
def __init__(self, permissions=0):
|
def __init__(self, permissions=0):
|
||||||
|
if not isinstance(permissions, int):
|
||||||
|
raise TypeError('Expected int parameter, received %s instead.' % permissions.__class__.__name__)
|
||||||
|
|
||||||
self.value = permissions
|
self.value = permissions
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user