Fixes broken support for: target.module[re.compile("libFoo")]
There were two issues:
- The type check was expecting re.SRE_Pattern
- 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.