"""
Consistent Overhead Byte Stuffing (COBS) encoding and decoding.

Functions are provided for encoding and decoding according to
the basic COBS method.

The COBS variant "Zero Pair Elimination" (ZPE) is not
implemented.

A C extension implementation only is provided.

References:
    http://www.stuartcheshire.org/papers/COBSforSIGCOMM/
    http://www.stuartcheshire.org/papers/COBSforToN.pdf
"""

from cobs._cobsext import *
_using_extension = True

"""
Consistent Overhead Byte Stuffing (COBS) encoding and decoding.

Functions are provided for encoding and decoding according to
the basic COBS method.

The COBS variant "Zero Pair Elimination" (ZPE) is not
implemented.

A pure Python implementation and a C extension implementation
are provided. If the C extension is not available for some reason,
the pure Python version will be used.

References:
    http://www.stuartcheshire.org/papers/COBSforSIGCOMM/
    http://www.stuartcheshire.org/papers/COBSforToN.pdf
"""

try:
    from cobs._cobsext import *
    _using_extension = True
except ImportError:
    from cobs._cobspy import *
    _using_extension = False

Change Python 2.x import to fall-back to pure Python code if it can't load the C extension.
Change Python 2.x import to fall-back to pure Python code if it can't load the C extension.
