Commit 14a52f00 authored by Michael Droettboom's avatar Michael Droettboom Committed by GitHub

Merge pull request #252 from mdboom/fix-pyimport

Fix iodide/#1151: PyDict_GetItem returns a borrowed reference
parents 9093723b 0b2d4ab6
......@@ -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(
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment