Skip to content

Commit fc728ce

Browse files
committed
add helper mx command "nativeclean"
1 parent bd55e76 commit fc728ce

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

graalpython/lib-graalpython/_io.py

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

680679

681680
# set the builtins open method
682681
import builtins
683682
setattr(builtins, 'open', open)
684-
setattr(globals(), 'open', open)

mx.graalpython/mx_graalpython.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
2222
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
2323
# OF THE POSSIBILITY OF SUCH DAMAGE.
24-
import json
2524
import os
2625
import platform
2726
import re
@@ -30,17 +29,15 @@
3029
import sys
3130
import tempfile
3231

33-
import mx_sdk
34-
3532
import mx
3633
import mx_benchmark
3734
import mx_gate
35+
import mx_sdk
3836
import mx_subst
3937
from mx_downstream import testdownstream
4038
from mx_gate import Task
4139
from mx_graalpython_benchmark import PythonBenchmarkSuite
4240
from mx_unittest import unittest
43-
from mx_urlrewrites import _urlrewrites
4441

4542
_suite = mx.suite('graalpython')
4643
_mx_graal = mx.suite("compiler", fatalIfMissing=False)
@@ -240,6 +237,11 @@ def punittest(args):
240237
def nativebuild(args):
241238
mx.build(["--only", "com.oracle.graal.python.cext,GRAALPYTHON"])
242239

240+
241+
def nativeclean(args):
242+
mx.run(['find', './graalpython/com.oracle.graal.python.test/src/tests/cpyext', '-name', '*.bc', '-delete'])
243+
244+
243245
# mx gate --tags pythonbenchmarktest
244246
# mx gate --tags pythontest
245247
# mx gate --tags fulltest
@@ -749,5 +751,6 @@ def python_checkcopyrights(args):
749751
'python-svm': [python_svm, 'run python svm image (building it if it is outdated'],
750752
'punittest': [punittest, ''],
751753
'nativebuild': [nativebuild, ''],
754+
'nativeclean': [nativeclean, ''],
752755
'python-so-test': [run_shared_lib_test, ''],
753756
})

0 commit comments

Comments
 (0)