@@ -90,13 +90,14 @@ def test_from_import_missing_attr_has_name_and_path(self):
9090self .assertEqual (cm .exception .path ,os .__file__ )
9191self .assertRegex (str (cm .exception ),r"cannot import name 'i_dont_exist' from 'os' \(.*os.py\)" )
9292
93+ @cpython_only
9394def test_from_import_missing_attr_has_name_and_so_path (self ):
94- import select
95+ import _testcapi
9596with self .assertRaises (ImportError )as cm :
96- from select import i_dont_exist
97- self .assertEqual (cm .exception .name ,'select ' )
98- self .assertEqual (cm .exception .path ,select .__file__ )
99- self .assertRegex (str (cm .exception ),r"cannot import name 'i_dont_exist' from 'select ' \(.*\.(so|pyd)\)" )
97+ from _testcapi import i_dont_exist
98+ self .assertEqual (cm .exception .name ,'_testcapi ' )
99+ self .assertEqual (cm .exception .path ,_testcapi .__file__ )
100+ self .assertRegex (str (cm .exception ),r"cannot import name 'i_dont_exist' from '_testcapi ' \(.*\.(so|pyd)\)" )
100101
101102def test_from_import_missing_attr_has_name (self ):
102103with self .assertRaises (ImportError )as cm :