mirror of https://github.com/pyodide/pyodide.git
Fix iodide/#1151: PyDict_GetItem returns a borrowed reference
This commit is contained in:
parent
9093723bab
commit
0b2d4ab6d7
|
@ -19,7 +19,6 @@ _pyimport(char* name)
|
|||
|
||||
Py_DECREF(pyname);
|
||||
int idval = python2js(pyval);
|
||||
Py_DECREF(pyval);
|
||||
return idval;
|
||||
}
|
||||
|
||||
|
|
|
@ -297,7 +297,6 @@ _python2js_cache(PyObject* x, PyObject* map)
|
|||
if (result != HW_ERROR) {
|
||||
result = hiwire_incref(result);
|
||||
}
|
||||
Py_DECREF(val);
|
||||
} else {
|
||||
result = _python2js(x, map);
|
||||
}
|
||||
|
|
|
@ -183,6 +183,13 @@ def test_import_js(selenium):
|
|||
assert result == 'Foo'
|
||||
|
||||
|
||||
def test_pyimport_multiple(selenium):
|
||||
"""See #1151"""
|
||||
selenium.run("v = 0.123")
|
||||
selenium.run_js("pyodide.pyimport('v')")
|
||||
selenium.run_js("pyodide.pyimport('v')")
|
||||
|
||||
|
||||
def test_pyproxy(selenium):
|
||||
selenium.run(
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue