gawel / pyquery

A jquery-like library for python
http://pyquery.rtfd.org/
Other
2.3k stars 182 forks source link

val() on nothing raises exception #147

Closed levkowetz closed 8 years ago

levkowetz commented 8 years ago

This returns None under 1.2.13, but raises an exception under 1.2.14. Should it?

` from pyquery import PyQuery

d = PyQuery('

') print(d.find('input[attr=bar]').val()) `

Traceback (most recent call last): File "bug.py", line 4, in <module> print(d.find('input[attr=bar]').val()) File "/home/henrik/src/db/trunk/local/lib/python2.7/site-packages/pyquery/pyquery.py", line 1002, in val return _get_value(self[0]) IndexError: list index out of range

gawel commented 8 years ago

Nope. Introduces at #134 I guess

gawel commented 8 years ago

fixed

levkowetz commented 8 years ago

Thanks for the quick fix and release!