This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix issue with re.Pattern availability
ClosedPublic

Authored by kastiglione on Nov 7 2022, 1:22 PM.

Details

Summary

re.Pattern is introduced in Python 3.7. To support Python 3.6, fallback to typechecking against SRE_Pattern.

Diff Detail

Event Timeline

kastiglione created this revision.Nov 7 2022, 1:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2022, 1:22 PM
kastiglione requested review of this revision.Nov 7 2022, 1:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2022, 1:22 PM

Simplify the fallback expression.

This revision is now accepted and ready to land.Nov 7 2022, 1:26 PM
mib accepted this revision.Nov 7 2022, 1:51 PM

LGTM! Anyway to test this ?

Anyway to test this ?

I don't have a Python 3.6 to test with. I did test locally which caught an issue, so I am at least confident it won't regress anything.

Use short circuit to avoid eager eval of re.SRE_Pattern

Switch to getting the type dynamically instead of by name.

This revision was automatically updated to reflect the committed changes.