Skip to content

Commit d1a86c2

Browse files
committed
fix setting the global "open" function
1 parent e52b9b9 commit d1a86c2

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/test_unicode.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@
3636
# SOFTWARE.
3737

3838
import sys
39-
import warnings
40-
from . import CPyExtTestCase, CPyExtFunction, CPyExtFunctionVoid, unhandled_error_compare, GRAALPYTHON
39+
40+
from . import CPyExtTestCase, CPyExtFunction, unhandled_error_compare, GRAALPYTHON
41+
4142
__dir__ = __file__.rpartition("/")[0]
4243

4344

@@ -326,7 +327,6 @@ def compile_module(self, name):
326327
cmpfunc=unhandled_error_compare
327328
)
328329

329-
# TODO enable once supported
330330
test_PyUnicode_GET_SIZE = CPyExtFunction(
331331
lambda args: len(args[0]),
332332
lambda: (

graalpython/lib-graalpython/_io.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,11 @@ def open(*args, **kwargs):
674674
import _pyio
675675
import builtins
676676
setattr(builtins, 'open', _pyio.open)
677+
globals()['open'] = _pyio.open
677678
return _pyio.open(*args, **kwargs)
678679

679680

680681
# set the builtins open method
681682
import builtins
682683
setattr(builtins, 'open', open)
684+
globals()['open'] = open

mx.graalpython/mx_graalpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def nativebuild(args):
239239

240240

241241
def nativeclean(args):
242-
mx.run(['find', './graalpython/com.oracle.graal.python.test/src/tests/cpyext', '-name', '*.bc', '-delete'])
242+
mx.run(['find', '.', '-name', '*.bc', '-delete'])
243243

244244

245245
# mx gate --tags pythonbenchmarktest

0 commit comments

Comments
 (0)