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

unused-argument is ignored if a function can raise an exception and does not return any value #3246

Closed
gcolombeau opened this issue Nov 15, 2019 · 0 comments · Fixed by #3385

Comments

@gcolombeau
Copy link

The checker for unused arguments fails to report on functions that do not return anything but contain a raise statement.

Steps to reproduce

"""
unused-argument check.
"""

def my_function(arg_1, *args, arg_2=None):
	"""My function does not use arg."""
	if arg_1 == 42:
		raise ValueError()

Current behavior

No unused arguments are reported.

Expected behavior

Unused arguments should be reported.

pylint --version output

pylint 2.4.4
astroid 2.3.3
Python 3.6.6 (default, Sep 25 2019, 09:49:31)
[GCC 5.4.0 20160609]

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