[all-commits] [llvm/llvm-project] 75f05f: [lldb][bindings] Fix module_access handling of regex
Dave Lee via All-commits
all-commits at lists.llvm.org
Sat Sep 3 10:33:49 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 75f05fccbbdd91393bdc7b6183b9dd2b1e859f8e
https://github.com/llvm/llvm-project/commit/75f05fccbbdd91393bdc7b6183b9dd2b1e859f8e
Author: Dave Lee <davelee.com at gmail.com>
Date: 2022-09-03 (Sat, 03 Sep 2022)
Changed paths:
M lldb/bindings/interface/SBTarget.i
M lldb/test/API/python_api/target/TestTargetAPI.py
Log Message:
-----------
[lldb][bindings] Fix module_access handling of regex
Fixes broken support for: `target.module[re.compile("libFoo")]`
There were two issues:
1. The type check was expecting `re.SRE_Pattern`
2. The expression to search the module path had a typo
In the first case, `re.SRE_Pattern` does not exist in Python 3, and is replaced
with `re.Pattern`.
While editing this code, I changed the type checks to us `isinstance`, which is
the conventional way of type checking.
>From the docs on `type()`:
> The `isinstance()` built-in function is recommended for testing the type of an object, because it takes subclasses into account.
Differential Revision: https://reviews.llvm.org/D133130
More information about the All-commits
mailing list