Axisymmetric stability of a toroidal pinch with non-circular cross-section