jendrikseipp / vulture

Find dead Python code
MIT License
3.5k stars 152 forks source link

Update core.py #176

Closed ssurbhi560 closed 5 years ago

ssurbhi560 commented 5 years ago

Description

Since visit_Str() is deprecated in Python3.8 so adding the visit_Constant() method . #175

Checklist:

RJ722 commented 5 years ago

Thank you @ssurbhi560 for the PR!

Your tests are failing because currently Vulture is reporting visit_Constant method as unused (because it's dynamically called).

You can add the following in vulture/whitelists/ast_whitelist.py and the tests would go green again:

whitelist_node_visitor.visit_Constant

However, I'm not entirely sure how we can add a test case for this new functionality.

jendrikseipp commented 5 years ago

I took the liberty of fixing this here: https://github.com/jendrikseipp/vulture/commit/c5b6417a03736fc25736ea1dcd23385c7c462089