Page MenuHomePhabricator

python bindings: fix DeprecationWarning
ClosedPublic

Authored by nickdesaulniers on Aug 10 2020, 3:22 PM.

Details

Summary

Fixes observed warning running ninja check-all:
llvm-project/clang/bindings/python/tests/cindex/test_diagnostics.py:100:
DeprecationWarning: Please use assertRegex instead.

self.assertRegexpMatches(children[0].spelling

Looks like unittest.assertRegexpMatches has been deprecated in favor of
unittest.assertRegex since Python 3.2, according to:
https://docs.python.org/3/library/unittest.html#deprecated-aliases

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2020, 3:22 PM
nickdesaulniers requested review of this revision.Aug 10 2020, 3:22 PM
MaskRay accepted this revision.Aug 10 2020, 3:23 PM

Thanks!

This revision is now accepted and ready to land.Aug 10 2020, 3:23 PM
This revision was landed with ongoing or failed builds.Aug 10 2020, 3:25 PM
This revision was automatically updated to reflect the committed changes.
jdenny added a subscriber: jdenny.Aug 19 2020, 6:24 PM

Does this mean we officially no longer support python 2, which this change breaks?

Does this mean we officially no longer support python 2, which this change breaks?

Send a patch to support both and I'll approve it.

Does this mean we officially no longer support python 2, which this change breaks?

Send a patch to support both and I'll approve it.

:-) I have no desire to support both. I'm asking whether I have to worry about python 2 when I do submit patches.