PyV8分段

2024-10-01 22:37:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我有以下代码。在

import PyV8

class Global(PyV8.JSClass):
     def __init__(self):
        pass

out = []
with PyV8.JSContext(Global()) as ctxt:
    ctxt.enter()
    op = ctxt.eval("function as(){return {'error':['ssda','sadsadds'], 'warning':[],'score':1};} as();")
    print(op['error'])

当我用python 3.4.3运行上面的代码时,我得到了Segmentation fault,而它与python2.6一起工作正常。
这是快照。在

enter image description here

^{pr2}$

我使用的是PyV8的1.0.dev0版本


Tags: 代码importselfinitdefaserrorpass

热门问题