nanomsg / nnpy

cffi-based Python bindings for nanomsg
MIT License
117 stars 39 forks source link

Fix incorrect args to super #36

Closed mtp401 closed 8 years ago

mtp401 commented 8 years ago

The arguments to the call to super within NNError are incorrect, resulting in:

File "/home/mpelland/.python_envs/chatty/lib/python2.7/site-packages/nnpy/socket.py", line 85, in recv
    errors.convert(rc)
  File "/home/mpelland/.python_envs/chatty/lib/python2.7/site-packages/nnpy/errors.py", line 13, in convert
    raise NNError(error_no, msg)
  File "/home/mpelland/.python_envs/chatty/lib/python2.7/site-packages/nnpy/errors.py", line 5, in __init__
    super().__init__(*args, **kwargs)
TypeError: super() takes at least 1 argument (0 given)

Reproduction scenario:

  1. Open a REQ-REP pair
  2. Set SNDTIMEO using setsockopt
  3. Attempt to receive
djc commented 8 years ago

Awesome, thank you!

It would be even better if you can put some code like the scenario you propose in a unit test so we make sure this code path gets exercised more. Think that's feasible?