File: exceptions.py

package info (click to toggle)
python-bitstring 4.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,312 kB
  • sloc: python: 11,397; makefile: 8; sh: 7
file content (23 lines) | stat: -rw-r--r-- 553 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

class Error(Exception):
    """Base class for errors in the bitstring module."""

    def __init__(self, *params: object) -> None:
        self.msg = params[0] if params else ''
        self.params = params[1:]


class ReadError(Error, IndexError):
    """Reading or peeking past the end of a bitstring."""


InterpretError = ValueError
"""Inappropriate interpretation of binary data."""


class ByteAlignError(Error):
    """Whole-byte position or length needed."""


CreationError = ValueError
"""Inappropriate argument during bitstring creation."""