The classical Prandtl–Batchelor theorem (Prandtl, Proc. Intl Mathematical Congress, Heidelberg, 1904, pp. 484–491; Batchelor, J. Fluid Mech., vol. 1 (02), 1956, pp. 177–190) states that in the regions of steady 2D flow where viscous forces are small and streamlines are closed, the vorticity is constant. In this paper, we extend this theorem to recirculating flows with quasiperiodic time dependence using ergodic and geometric analysis of Lagrangian dynamics. In particular, we show that 2D quasiperiodic viscous flows, in the limit of zero viscosity, cannot converge to recirculating inviscid flows with non-uniform vorticity distribution. A corollary of this result is that if the vorticity contours form a family of closed curves in a quasiperiodic viscous flow, then at the limit of zero viscosity, vorticity is constant in the area enclosed by those curves at all times.