Author: Armin Rigo <[email protected]>
Branch:
Changeset: r90281:1c6f372c0035
Date: 2017-02-22 08:07 +0000
http://bitbucket.org/pypy/pypy/changeset/1c6f372c0035/
Log: Merged in fniephaus/pypy/space-wrap (pull request #518)
Avoid space.wrap when possible
Approved-by: Armin Rigo
diff --git a/pypy/interpreter/main.py b/pypy/interpreter/main.py
--- a/pypy/interpreter/main.py
+++ b/pypy/interpreter/main.py
@@ -18,7 +18,8 @@
def compilecode(space, source, filename, cmd='exec'):
w_code = space.builtin.call(
- 'compile', space.wrap(source), space.wrap(filename), space.wrap(cmd),
space.newint(0), space.newint(0))
+ 'compile', space.newtext(source), space.newtext(filename),
+ space.newtext(cmd), space.newint(0), space.newint(0))
pycode = space.interp_w(eval.Code, w_code)
return pycode
@@ -85,10 +86,11 @@
argv.extend(args)
space.setitem(space.sys.w_dict, space.newtext('argv'), space.wrap(argv))
w_import = space.builtin.get('__import__')
- runpy = space.call_function(w_import, space.wrap('runpy'))
- w_run_module = space.getitem(runpy.w_dict, space.wrap('run_module'))
- return space.call_function(w_run_module, space.wrap(module_name),
space.w_None,
- space.wrap('__main__'), space.w_True)
+ runpy = space.call_function(w_import, space.newtext('runpy'))
+ w_run_module = space.getitem(runpy.w_dict, space.newtext('run_module'))
+ return space.call_function(w_run_module, space.newtext(module_name),
+ space.w_None, space.newtext('__main__'),
+ space.w_True)
def run_toplevel(space, f, verbose=False):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit