google / atheris

Apache License 2.0
1.38k stars 111 forks source link

chore: fix DeprecationWarning for python 3.11 re module #61

Closed Ziemnior closed 1 year ago

Ziemnior commented 1 year ago

I couldn't find any info besides CLA in the CONTRIBUTING, so hopefully this PR is sufficient for you in terms of description, code style, commit name etc. Using pyenv 3.110b5 python version, I've noticed plenty of DeprecationWarning as below:

/home/username/.pyenv/versions/3.11.0b5/envs/project/lib/python3.11/site-packages/atheris/function_hooks.py:17: DeprecationWarning: module 'sre_parse' is deprecated
    import sre_parse

And one of the first links in google lead me to a very similar issue on Hipothesis project: https://github.com/HypothesisWorks/hypothesis/issues/3309

So I've copied it to mitigate said DeprecationWarning. If you'd prefer if statement checking whether python version is equal or greater than 3.11 in this place instead of try/except clause, please let me know.

google-cla[bot] commented 1 year ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.