Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix number of arguments passed to _on_return callback #496

Merged
merged 1 commit into from
May 20, 2015
Merged

Fix number of arguments passed to _on_return callback #496

merged 1 commit into from
May 20, 2015

Conversation

aeirola
Copy link

@aeirola aeirola commented Aug 1, 2014

Callback function added with add_on_return_callback received all arguments within a tuple. This should fix it.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.11%) when pulling b5f52fb on aeirola:master into f8c263f on pika:master.

@sjlongland
Copy link

I've been confused about this issue myself. Either the documentation is wrong or the code is wrong.

I thought I was doing something wrong in my code, and it's only when I went digging I found this pull request.

It is not a difficult to fix code that uses the old (broken?) behaviour:

def on_return(on_return_tuple):
    (channel, basic_return, properties, body) = on_return_tuple
    # ...

can be changed to:

def on_return(*on_return_tuple):
    (channel, basic_return, properties, body) = on_return_tuple
    # ...

The question remains, how many people would be inconvenienced by this, versus how many are being inconvenienced by on_return callbacks that don't work for mysterious reasons?

@gmr gmr merged commit b5f52fb into pika:master May 20, 2015
@gmr
Copy link
Member

gmr commented May 20, 2015

With the 0.10.0 change, I'm ok with the API change. Thanks for the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants