def test_PEP_3149(self):
"""Test that Python 3 modules importing native modules can find
them in the right place, following PEP 3149.
On Solaris, this means 64-bit only, and with the "m" (pymalloc)
flag turned on.
"""
# Create a python 3.x file that imports a native module.
tp = self.make_manifest(
self.pyver_test_manf_1.format(py_ver="3.4"))
fp = "usr/lib/python{0}/vendor-packages/pkg/" \
"client/indexer.py".format("3.4")
self.make_proto_text_file(fp, self.python3_so_text)
# Run generate
self.pkgdepend_generate("-m -d {0} {1}".format(
self.test_proto_dir, tp))
# Take the output, split it into actions, and find exactly one
# action which generated a correct dependency on zlib based on
# indexer.py.
pfx = base.Dependency.DEPEND_DEBUG_PREFIX
acts = [
a
for a in (
actions.fromstr(l)
for l in self.output.strip().splitlines()
)
if a.attrs.get(pfx + ".reason") == fp and
"64/zlib.cpython-34m.so" in a.attrs[pfx + ".file"]
]
self.assertTrue(len(acts) == 1)
self.check_res("", self.errout)
评论列表
文章目录