Implement bpo-27535: Fix memory leak with warnings ignore

Merged Yannick Jadoul requested to merge topic/py3.7/py3.7-bpo-27535 into branch/py3.7

This should fix the test.test_warnings.CFilterTests failing test in test_warnings.

See https://bugs.python.org/issue27535 & https://github.com/python/cpython/pull/4489

As far as I know, https://github.com/python/cpython/pull/4508 and https://github.com/python/cpython/pull/4516 cannot/do not have to be implemented, since PyPy doesn't use an equivalent of _Py_IDENTIFIER?

Edited by Yannick Jadoul

Merge request reports