[EDIT] after some quick test
view.draw_polyline works fine, but are you sure you execute your code within the drawmethod of a Tool (this is the only place where view.draw methods can work)?
Otherwise, if you want to draw a polyline, you could also use view.draw GL_LINESTRIP, pt1, pt2, ...
If you want to draw segments with each pair of points, use view_draw_lineor view.draw_lines. Very handy to draw in one shot a complex shape that you pre-calculated.