error.py 353 B

1234567891011121314151617
  1. """zmq error functions"""
  2. # Copyright (C) PyZMQ Developers
  3. # Distributed under the terms of the Modified BSD License.
  4. from ._cffi import C, ffi
  5. def strerror(errno):
  6. s = ffi.string(C.zmq_strerror(errno))
  7. if not isinstance(s, str):
  8. # py3
  9. s = s.decode()
  10. return s
  11. zmq_errno = C.zmq_errno
  12. __all__ = ['strerror', 'zmq_errno']