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

don't pass down 'max_ver' as keyword to fancylogger.deprecated #1899

Merged
merged 5 commits into from
Sep 7, 2016

Conversation

boegel
Copy link
Member

@boegel boegel commented Sep 5, 2016

This should have been part of #1896...

@JensTimmerman please review?

@boegel boegel added this to the v2.9.0 milestone Sep 5, 2016
@JensTimmerman
Copy link
Contributor

ok, can you add a test case that would have triggered this?

@boegel
Copy link
Member Author

boegel commented Sep 6, 2016

@JensTimmerman good point, adding tests made me realise there was another issue in log.deprecated, since max_ver can also be passed unnamed via *args

please rerereview?

max_ver = kwargs.pop('max_ver', None)
if max_ver is None and args:
max_ver = args[0]
args = args[1:]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have no way to know that max_ver will be args[0], so please don't do this, if you expect it,
make the function definition
def deprecated(self, msg, ver, max_ver=None,*args, **kwargs):
`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, thanks

@boegel boegel changed the title don't pass down 'max_ver' to fancylogger.deprecated don't pass down 'max_ver' as keyword to fancylogger.deprecated Sep 7, 2016
@JensTimmerman
Copy link
Contributor

looks good to me

@boegel
Copy link
Member Author

boegel commented Sep 7, 2016

Thanks for the review @JensTimmerman!

@boegel boegel merged commit dfc18bb into easybuilders:develop Sep 7, 2016
@boegel boegel deleted the fix_deprecated branch September 7, 2016 08:49
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.

2 participants