Skip to content

Commit 48750f9

Browse files
author
Adam Hrbac
committed
[GR-40372] Compatibility with flask
PullRequest: graalpython/2425
2 parents 513a262 + a8fde0e commit 48750f9

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ language runtime. The main focus is on user-observable behavior of the engine.
99
* New parser generated from CPython's new PEG grammar definition. It brings better compatibility and enables us to implement the `ast` module.
1010
* Added support for tracing API (`sys.settrace`) which makes `pdb` and related tools work on GraalPy.
1111
* Updated our pip support to automatically choose the best version for known packages. You can use `pip install pandas`, and pip will select the versions of pandas and numpy that we test in the GraalPy CI.
12+
* Added support for Flask - https://pypi.org/project/Flask/
1213

1314
## Version 22.2.0
1415
* Updated to HPy version 0.0.4, which adds support for the finished HPy port of Kiwi, and the in-progress ports of Matplotlib and NumPy.

graalpython/com.oracle.graal.python.cext/src/unicodeobject.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,3 +701,6 @@ PyUnicode_DecodeLatin1(const char *s,
701701
return _PyUnicode_FromUCS1((const unsigned char*)s, size);
702702
}
703703

704+
int _PyUnicode_EqualToASCIIId(PyObject *left, _Py_Identifier *right) {
705+
return _PyUnicode_EqualToASCIIString(left, right->string);
706+
}

graalpython/com.oracle.graal.python.test/src/tests/test_code.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,10 @@ def inner():
249249
if type(const) == types.CodeType:
250250
code = const
251251
assert "this is fun" in code.co_consts
252+
253+
254+
def test_consts_do_not_leak_java_types():
255+
codestr = "['root']"
256+
code = compile(codestr, '<test>', 'exec')
257+
for const in code.co_consts:
258+
assert isinstance(const, (str, tuple)) or const is None
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*graalpython.lib-python.3.test.test_stringprep.StringprepTests.test

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/code/PCode.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
import com.oracle.graal.python.nodes.generator.GeneratorFunctionRootNode;
8080
import com.oracle.graal.python.nodes.literal.SimpleLiteralNode;
8181
import com.oracle.graal.python.nodes.literal.TupleLiteralNode;
82+
import com.oracle.graal.python.nodes.object.IsForeignObjectNode;
8283
import com.oracle.graal.python.runtime.GilNode;
8384
import com.oracle.graal.python.runtime.PythonContext;
8485
import com.oracle.graal.python.runtime.object.PythonObjectFactory;
@@ -633,7 +634,12 @@ private static Object convertConstantToPythonSpace(RootNode rootNode, Object o)
633634
Object[] array = new Object[strings.length];
634635
System.arraycopy(strings, 0, array, 0, strings.length);
635636
return factory.createTuple(array);
637+
} else if (o instanceof Object[]) {
638+
Object[] objects = (Object[]) o;
639+
return factory.createTuple(objects.clone());
636640
}
641+
// Ensure no conversion is missing
642+
assert !IsForeignObjectNode.getUncached().execute(o);
637643
return o;
638644
}
639645

0 commit comments

Comments
 (0)