[pypy-commit] pypy py3.5-async-translate: assert is instance Module, rpython deduces it is a W_Root
plan_rich
pypy.commits at gmail.com
Tue Aug 9 11:38:55 EDT 2016
Author: Richard Plangger <planrichi at gmail.com>
Branch: py3.5-async-translate
Changeset: r86116:435335a96064
Date: 2016-08-09 17:38 +0200
http://bitbucket.org/pypy/pypy/changeset/435335a96064/
Log: assert is instance Module, rpython deduces it is a W_Root properly
wrap for load const
diff --git a/pypy/interpreter/astcompiler/codegen.py b/pypy/interpreter/astcompiler/codegen.py
--- a/pypy/interpreter/astcompiler/codegen.py
+++ b/pypy/interpreter/astcompiler/codegen.py
@@ -1310,7 +1310,7 @@
nsubkwargs += 1
elif nsubkwargs:
# A keyword argument and we already have a dict.
- self.load_const(kw.arg)
+ self.load_const(self.space.wrap(kw.arg.decode('utf-8')))
kw.value.walkabout(self)
nseen += 1
else:
diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py
--- a/pypy/module/imp/importing.py
+++ b/pypy/module/imp/importing.py
@@ -85,6 +85,7 @@
pathname = "<frozen %s>" % modulename
code_w = ec.compiler.compile(source, pathname, 'exec', 0)
w_mod = add_module(space, space.wrap(modulename))
+ assert isinstance(w_mod, Module) # XXX why is that necessary?
space.setitem(space.sys.get('modules'), w_mod.w_name, w_mod)
space.setitem(w_mod.w_dict, space.wrap('__name__'), w_mod.w_name)
code_w.exec_code(space, w_mod.w_dict, w_mod.w_dict)
More information about the pypy-commit
mailing list