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

Function.__str__ can raise a TypeError on special FunctionTypes #1170

Closed
ESultanik opened this issue Apr 15, 2022 · 0 comments · Fixed by #1171
Closed

Function.__str__ can raise a TypeError on special FunctionTypes #1170

ESultanik opened this issue Apr 15, 2022 · 0 comments · Fixed by #1171
Assignees
Labels
bug Something isn't working

Comments

@ESultanik
Copy link
Member

ESultanik commented Apr 15, 2022

Describe the issue:

For special function types like FunctionType.CONSTRUCTOR_VARIABLES, the Function._name member variable will be None, yet the Function.name property will return a string as expected ("slitherConstructorVariables"). Function.__str__, however, returns self._name rather than self.name. Returning None from __str__ raises a TypeError at runtime.

Code example to reproduce the issue:

Every function for which Function._function_type == FunctionType.CONSTRUCTOR_VARIABLES seems to have this problem.

Version:

0.8.2

Relevant log output:

No response

@ESultanik ESultanik added the bug-candidate Bugs reports that are not yet confirmed label Apr 15, 2022
@ESultanik ESultanik self-assigned this Apr 15, 2022
@ESultanik ESultanik added bug Something isn't working and removed bug-candidate Bugs reports that are not yet confirmed labels Apr 15, 2022
ESultanik added a commit that referenced this issue Apr 15, 2022
montyly pushed a commit that referenced this issue Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants