thenoviceoof / pyli

Better python CLI integration
MIT License
9 stars 1 forks source link

--pprint fails printing lists #25

Closed thenoviceoof closed 10 years ago

thenoviceoof commented 10 years ago

This fails:

 pyli --pprint '[]'

with

Traceback (most recent call last):
  File "/usr/local/bin/pyli", line 56, in <module>
    pyli.main(program, debug=debug, variables=kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pyli/__init__.py", line 570, in main
    read_tree = print_last_statement(read_tree, gensym_generator)
  File "/usr/local/lib/python2.7/dist-packages/pyli/__init__.py", line 433, in print_last_statement
    tree = edit_last_stmt(tree, last_stmt_fn=ensure_equality)
  File "/usr/local/lib/python2.7/dist-packages/pyli/__init__.py", line 299, in edit_last_stmt
    return edit_last_stmt_runner(tree, expr, last_stmt_fn)[0]
  File "/usr/local/lib/python2.7/dist-packages/pyli/__init__.py", line 313, in edit_last_stmt_runner
    if t[0] in ('stmt', 'simple_stmt')][0] + 1
IndexError: list index out of range
thenoviceoof commented 10 years ago

Can't repro.