mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-20 20:33:17 +00:00
PendingDeprecationWarning -> DeprecationWarning (#321)
This commit is contained in:
parent
9e210bfc1a
commit
1bf62ba6f8
3 changed files with 7 additions and 7 deletions
|
@ -121,7 +121,7 @@ cdef class Packer(object):
|
||||||
bint use_single_float=False, bint autoreset=True, bint use_bin_type=False,
|
bint use_single_float=False, bint autoreset=True, bint use_bin_type=False,
|
||||||
bint strict_types=False):
|
bint strict_types=False):
|
||||||
if encoding is not None:
|
if encoding is not None:
|
||||||
PyErr_WarnEx(PendingDeprecationWarning, "encoding is deprecated.", 1)
|
PyErr_WarnEx(DeprecationWarning, "encoding is deprecated.", 1)
|
||||||
self.use_float = use_single_float
|
self.use_float = use_single_float
|
||||||
self.strict_types = strict_types
|
self.strict_types = strict_types
|
||||||
self.autoreset = autoreset
|
self.autoreset = autoreset
|
||||||
|
|
|
@ -186,7 +186,7 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
|
||||||
cdef int new_protocol = 0
|
cdef int new_protocol = 0
|
||||||
|
|
||||||
if encoding is not None:
|
if encoding is not None:
|
||||||
PyErr_WarnEx(PendingDeprecationWarning, "encoding is deprecated, Use raw=False instead.", 1)
|
PyErr_WarnEx(DeprecationWarning, "encoding is deprecated, Use raw=False instead.", 1)
|
||||||
cenc = encoding
|
cenc = encoding
|
||||||
|
|
||||||
if unicode_errors is not None:
|
if unicode_errors is not None:
|
||||||
|
@ -213,7 +213,7 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
|
||||||
|
|
||||||
def unpack(object stream, **kwargs):
|
def unpack(object stream, **kwargs):
|
||||||
PyErr_WarnEx(
|
PyErr_WarnEx(
|
||||||
PendingDeprecationWarning,
|
DeprecationWarning,
|
||||||
"Direct calling implementation's unpack() is deprecated, Use msgpack.unpack() or unpackb() instead.", 1)
|
"Direct calling implementation's unpack() is deprecated, Use msgpack.unpack() or unpackb() instead.", 1)
|
||||||
data = stream.read()
|
data = stream.read()
|
||||||
return unpackb(data, **kwargs)
|
return unpackb(data, **kwargs)
|
||||||
|
@ -360,7 +360,7 @@ cdef class Unpacker(object):
|
||||||
self.stream_offset = 0
|
self.stream_offset = 0
|
||||||
|
|
||||||
if encoding is not None:
|
if encoding is not None:
|
||||||
PyErr_WarnEx(PendingDeprecationWarning, "encoding is deprecated, Use raw=False instead.", 1)
|
PyErr_WarnEx(DeprecationWarning, "encoding is deprecated, Use raw=False instead.", 1)
|
||||||
self.encoding = encoding
|
self.encoding = encoding
|
||||||
cenc = encoding
|
cenc = encoding
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ def _get_data_from_buffer(obj):
|
||||||
def unpack(stream, **kwargs):
|
def unpack(stream, **kwargs):
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"Direct calling implementation's unpack() is deprecated, Use msgpack.unpack() or unpackb() instead.",
|
"Direct calling implementation's unpack() is deprecated, Use msgpack.unpack() or unpackb() instead.",
|
||||||
PendingDeprecationWarning)
|
DeprecationWarning)
|
||||||
data = stream.read()
|
data = stream.read()
|
||||||
return unpackb(data, **kwargs)
|
return unpackb(data, **kwargs)
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ class Unpacker(object):
|
||||||
if encoding is not None:
|
if encoding is not None:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"encoding is deprecated, Use raw=False instead.",
|
"encoding is deprecated, Use raw=False instead.",
|
||||||
PendingDeprecationWarning)
|
DeprecationWarning)
|
||||||
|
|
||||||
if unicode_errors is None:
|
if unicode_errors is None:
|
||||||
unicode_errors = 'strict'
|
unicode_errors = 'strict'
|
||||||
|
@ -727,7 +727,7 @@ class Packer(object):
|
||||||
else:
|
else:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"encoding is deprecated, Use raw=False instead.",
|
"encoding is deprecated, Use raw=False instead.",
|
||||||
PendingDeprecationWarning)
|
DeprecationWarning)
|
||||||
|
|
||||||
if unicode_errors is None:
|
if unicode_errors is None:
|
||||||
unicode_errors = 'strict'
|
unicode_errors = 'strict'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue