atabac / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Calling generator with wrong number of args fails to raise TypeError #121

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Get:

ipm> def gen(o): yield o

ipm> f = gen()
ipm> f.next()
Traceback (most recent call first):
  File "<ipm>", line 1, in <ipm>
  File "../lib/ipm.py", line 99, in ipm
  File "main.py", line 19, in main
Error code 0xFC detected by obj.c:349

Expect:

>>> def gen(o): yield o
... 
>>> f = gen()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: gen() takes exactly 1 argument (0 given)

Original issue reported on code.google.com by dwhall...@gmail.com on 7 Aug 2010 at 4:30

GoogleCodeExporter commented 9 years ago
r567
- Added system test t321 which calls a generator with the wrong number of args 
and expects a TypeError.
- Fixed interp.c CALL_FUNC for the case of a generator (copied code black that 
checks for the proper number of args).

Original comment by dwhall...@gmail.com on 7 Aug 2010 at 6:04