Skip to content

Instantly share code, notes, and snippets.

@Wilfred
Created February 10, 2014 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wilfred/8925923 to your computer and use it in GitHub Desktop.
Save Wilfred/8925923 to your computer and use it in GitHub Desktop.
RPython just gives an assertion error here
[translation:info] Error:
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/goal/translate.py", line 318, in main
[translation:info] drv.proceed(goals)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 534, in proceed
[translation:info] return self._execute(goals, task_skip = self._maybe_skip())
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute
[translation:info] res = self._do(goal, taskcallable, *args, **kwds)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 283, in _do
[translation:info] res = func()
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 350, in task_rtype_lltype
[translation:info] rtyper.specialize(dont_simplify_again=True)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/rtyper/rtyper.py", line 181, in specialize
[translation:info] self.specialize_more_blocks()
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/rtyper/rtyper.py", line 222, in specialize_more_blocks
[translation:info] self.specialize_block(block)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/rtyper/rtyper.py", line 340, in specialize_block
[translation:info] self.translate_hl_to_ll(hop, varmapping)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/rtyper/rtyper.py", line 469, in translate_hl_to_ll
[translation:info] resultvar = hop.dispatch()
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/rtyper/rtyper.py", line 698, in dispatch
[translation:info] return translate_meth(self)
[translation:info] File "<285-codegen /home/wilfred/projects/trifle/src/pypy/rpython/rtyper/rtyper.py:549>", line 5, in translate_op_eq
[translation:info] return pair(r_arg1, r_arg2).rtype_eq(hop)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/rtyper/rptr.py", line 172, in rtype_eq
[translation:info] vlist = hop.inputargs(r_ptr, r_ptr)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/rtyper/rtyper.py", line 729, in inputargs
[translation:info] vars.append(self.inputarg(converted_to[i], i))
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/rtyper/rtyper.py", line 718, in inputarg
[translation:info] return self.llops.convertvar(v, r_binding, converted_to)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/rtyper/rtyper.py", line 860, in convertvar
[translation:info] v = pair(r_from, r_to).convert_from_to(v, self)
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/rtyper/rptr.py", line 115, in convert_from_to
[translation:info] assert r_ptr1.lowleveltype == r_ptr2.lowleveltype
import sys
import os
def fake_raw_input():
STDIN = 0
user_string = os.read(STDIN, 1024)[:-1] # discard the trailing last newline
return user_string
def entry_point(argv):
my_input = fake_raw_input()
# comparing unicode with string! woops!
if my_input.decode('utf-8') == my_input:
print "yes"
else:
print "no"
return 1
def target(*args):
return entry_point, None
if __name__ == '__main__':
entry_point(sys.argv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment