The first line should probably be something like `p, q = Poly(p), Poly(q)`.