class documentation

class OsError(_Generic[OsComponent], ValueError):

View In Hierarchy

Error that is raised when there is an incompatibility between the OS and the expected OS.

Method __init__ Initializes a new instance of this class.
Method __repr__ Returns the "official" string representation of this instance.
Method __str__ Returns the nicely printable string representation of this instance.
Method expected The OS components that would have been compatible.
Method got The OS component that wasn't conformant.
Method message The additional message, if any.
Method _incompatible_message Undocumented
Instance Variable _expected Undocumented
Instance Variable _got Undocumented
Instance Variable _message Undocumented
def __init__(self, got, expected=(), message=None):

Initializes a new instance of this class.

Usually used in a raise statement, and results in an error looking like:

    reven2.ossi.os.OsError: Got 'Windows 10', expected one of: 'Windows 7', 'Windows 8'

Information

Parameters
got:_Optional[OsComponent]the OS component (full OS, family, architecture, version, kernel_version) that wasn't conformant.
expected:_Iterable[OsComponent]either a single or a list of the OS components that would have been compatible. If provided with the empty list, changes the base message from "Got x expected y" to "Incompatible OS x".
message:_Optional[str]an optional additional message to append to the error. It does not replace the "base message" ("Got x expected y").
def __repr__(self):

Returns the "official" string representation of this instance.

Returns
strUndocumented
def __str__(self):

Returns the nicely printable string representation of this instance.

Returns
strUndocumented
def expected(self):

The OS components that would have been compatible.

Returns
_Iterator[OsComponent]Undocumented
def got(self):

The OS component that wasn't conformant.

Returns
_Optional[OsComponent]Undocumented
def message(self):

The additional message, if any.

Returns
_Optional[str]Undocumented
def _incompatible_message(self):

Undocumented

Returns
strUndocumented
_expected: _List[OsComponent] =

Undocumented

_got: _Optional[OsComponent] =

Undocumented

_message =

Undocumented