Fixed searching for binary Python 3.5 modules on Mac OS X (PY-17282)

Our binary module regexp was special-cased for the '-linux-gnu' suffix
and didn't take into account other variants.
This commit is contained in:
Andrey Vlasovskikh
2015-11-03 16:07:45 +03:00
parent 8b4b6eef3a
commit 064c9a4ed1
3 changed files with 24 additions and 1 deletions
@@ -783,7 +783,7 @@ MAC_SKIP_MODULES = ["test", "ctypes/test", "distutils/tests", "email/test",
POSIX_SKIP_MODULES = ["vtemodule", "PAMmodule", "_snackmodule", "/quodlibet/_mmkeys"]
BIN_MODULE_FNAME_PAT = re.compile('([a-zA-Z_]+[0-9a-zA-Z]*)\\.(?:pyc|pyo|(?:[a-zA-Z_]+-\\d\\d[a-zA-Z]*\\.|.+-linux-gnu\\.)?(?:so|pyd))')
BIN_MODULE_FNAME_PAT = re.compile('([a-zA-Z_]+[0-9a-zA-Z]*)\\.(?:pyc|pyo|(?:[a-zA-Z_]+-\\d\\d[a-zA-Z]*(?:-[a-zA-Z_0-9\-]+)?\\.)?(?:so|pyd))')
# possible binary module filename: letter, alphanum architecture per PEP-3149
TYPELIB_MODULE_FNAME_PAT = re.compile("([a-zA-Z_]+[0-9a-zA-Z]*)[0-9a-zA-Z-.]*\\.typelib")
@@ -0,0 +1,5 @@
import binascii
import <error descr="No module named nonexistent">nonexistent</error>
print(binascii, nonexistent)
@@ -175,6 +175,24 @@ public class PythonSkeletonsTest extends PyEnvTestCase {
});
}
// PY-17282
public void testBinaryStandardModule() {
runTest(new SkeletonsTask() {
@Override
protected void runTestOn(@NotNull Sdk sdk) {
myFixture.configureByFile(getTestName(false) + ".py");
myFixture.enableInspections(PyUnresolvedReferencesInspection.class);
edt(new Runnable() {
@Override
public void run() {
myFixture.checkHighlighting(true, false, false);
}
});
}
});
}
private void runTest(@NotNull PyTestTask task) {
runPythonTest(task);