[pypy-dev] RPython translation error on generated code

Timothy Baldridge tbaldridge at gmail.com
Tue May 1 18:21:04 EDT 2018


I have a strange error, I'm generating code for a RPython program and get
this error:

[translation:ERROR] AttributeError: 'FrozenDesc' object has no attribute
'pycall'
Processing block:
 block at 9[fn_0...] is a <class 'rpython.flowspace.flowcontext.SpamBlock'>
 in (?:10)make_thunk
 containing the following operations:
       v2 = simple_call((type Thunk_thunk10_), fn_0, args_0)


And I'm generating it thusly:

thunk_template = """
class Thunk_{sym}(ThunkBase):
  def __init__(self, fn, args):
     self._{sym}_fn = fn
     self._{sym}_args = args

  def run_thunk(self):
     return self._{sym}_fn(*self._{sym}_args)

def make_thunk(fn, args):
  return Thunk_{sym}(fn, args)
"""



def make_thunk():
    gbls = dict(ThunkBase=ThunkBase, object=object)
    sym = gen_sym.get_sym("thunk")
    code = thunk_template.format(sym=sym)
    exec(code, gbls)
    cls = gbls["make_thunk"]
    return cls


It's as if RPython isn't recognizing that the type is callable.

Any thoughts?

Thanks,

Timothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20180501/6a240092/attachment.html>


More information about the pypy-dev mailing list