Solution (source code)

= Solution

The integration region is the triangle $0\leq y\leq x\leq\pi$. Reversing its order gives
$$
I=\int_0^\pi\int_0^x\frac{\sin x}{x}\,dy\,dx=\int_0^\pi\sin x\,dx=\boxed{2.}
$$
The factor of $x$ from the inner interval cancels the denominator. At $x=0$, $\sin x/x$ has a removable singularity, so no divergent integral is being hidden by this change of order. <Fubini's theorem> applies to its continuous extension on the bounded triangle.