mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-28 08:04:12 +00:00
use relative imports (#357)
Some applications use msgpack to store persistent data and require a specific msgpack version (e.g. borgbackup). Bundling helps in case there is an (incompatible) version of msgpack in a system-wide install.
This commit is contained in:
parent
737f08a885
commit
05ff11dbcc
4 changed files with 10 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# coding: utf-8
|
||||
from msgpack._version import version
|
||||
from msgpack.exceptions import *
|
||||
from ._version import version
|
||||
from .exceptions import *
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
|
@ -19,12 +19,12 @@ class ExtType(namedtuple('ExtType', 'code data')):
|
|||
|
||||
import os
|
||||
if os.environ.get('MSGPACK_PUREPYTHON'):
|
||||
from msgpack.fallback import Packer, unpackb, Unpacker
|
||||
from .fallback import Packer, unpackb, Unpacker
|
||||
else:
|
||||
try:
|
||||
from msgpack._cmsgpack import Packer, unpackb, Unpacker
|
||||
from ._cmsgpack import Packer, unpackb, Unpacker
|
||||
except ImportError:
|
||||
from msgpack.fallback import Packer, unpackb, Unpacker
|
||||
from .fallback import Packer, unpackb, Unpacker
|
||||
|
||||
|
||||
def pack(o, stream, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue