diff options
author | INADA Naoki <methane@users.noreply.github.com> | 2018-02-23 15:41:21 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-23 15:41:21 +0900 |
commit | ae3a6ba0b04487d7108360d1d504332aed079556 (patch) | |
tree | 16061fe26078d25e7743d672f2c36067397aea7a /msgpack/_unpacker.pyx | |
parent | f38c1a3674b7623080cb774b56ede21383bde04a (diff) | |
download | msgpack-python-ae3a6ba0b04487d7108360d1d504332aed079556.tar.gz |
Deprecate implementation module's unpack() (#290)
Diffstat (limited to 'msgpack/_unpacker.pyx')
-rw-r--r-- | msgpack/_unpacker.pyx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/msgpack/_unpacker.pyx b/msgpack/_unpacker.pyx index 3843e92..d7fa5bc 100644 --- a/msgpack/_unpacker.pyx +++ b/msgpack/_unpacker.pyx @@ -212,12 +212,9 @@ def unpackb(object packed, object object_hook=None, object list_hook=None, def unpack(object stream, **kwargs): - """ - Unpack an object from `stream`. - - Raises `ValueError` when `stream` has extra bytes. - See :class:`Unpacker` for options. - """ + PyErr_WarnEx( + PendingDeprecationWarning, + "Direct calling implementation's unpack() is deprecated, Use msgpack.unpack() or unpackb() instead.", 1) data = stream.read() return unpackb(data, **kwargs) |