mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-20 04:13:16 +00:00
Remove deprecated exception classes (#323)
This commit is contained in:
parent
1bf62ba6f8
commit
07f0beeabb
4 changed files with 84 additions and 95 deletions
|
@ -1,6 +1,10 @@
|
|||
class UnpackException(Exception):
|
||||
"""Deprecated. Use Exception instead to catch all exception during unpacking."""
|
||||
"""Base class for some exceptions raised while unpacking.
|
||||
|
||||
NOTE: unpack may raise exception other than subclass of
|
||||
UnpackException. If you want to catch all error, catch
|
||||
Exception instead.
|
||||
"""
|
||||
|
||||
class BufferFull(UnpackException):
|
||||
pass
|
||||
|
@ -10,11 +14,16 @@ class OutOfData(UnpackException):
|
|||
pass
|
||||
|
||||
|
||||
class UnpackValueError(UnpackException, ValueError):
|
||||
"""Deprecated. Use ValueError instead."""
|
||||
# Deprecated. Use ValueError instead
|
||||
UnpackValueError = ValueError
|
||||
|
||||
|
||||
class ExtraData(UnpackValueError):
|
||||
"""ExtraData is raised when there is trailing data.
|
||||
|
||||
This exception is raised while only one-shot (not streaming)
|
||||
unpack.
|
||||
"""
|
||||
def __init__(self, unpacked, extra):
|
||||
self.unpacked = unpacked
|
||||
self.extra = extra
|
||||
|
@ -23,19 +32,7 @@ class ExtraData(UnpackValueError):
|
|||
return "unpack(b) received extra data."
|
||||
|
||||
|
||||
class PackException(Exception):
|
||||
"""Deprecated. Use Exception instead to catch all exception during packing."""
|
||||
|
||||
|
||||
class PackValueError(PackException, ValueError):
|
||||
"""PackValueError is raised when type of input data is supported but it's value is unsupported.
|
||||
|
||||
Deprecated. Use ValueError instead.
|
||||
"""
|
||||
|
||||
|
||||
class PackOverflowError(PackValueError, OverflowError):
|
||||
"""PackOverflowError is raised when integer value is out of range of msgpack support [-2**31, 2**32).
|
||||
|
||||
Deprecated. Use ValueError instead.
|
||||
"""
|
||||
#Deprecated. Use Exception instead to catch all exception during packing.
|
||||
PackException = Exception
|
||||
PackValueError = ValueError
|
||||
PackOverflowError = OverflowError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue