A self-duality group G in quantum field theory can have anomalies. In that case, the space of ordinary coupling constants M can be extended to include the space F of coefficients of counterterms in background fields. The extended space N forms a bundle over M with fiber F , and the topology of the bundle is determined by the anomaly. For example, the G = SL(2, Z) duality of the 4d Maxwell theory has an anomaly, and the space F = S 1 for the gravitational theta-angle is nontrivially fibered over M = H/SL(2, Z). We will explain a simple method to determine the anomaly when the 4d theory is obtained by compactifying a 6d theory on a Riemann surface in terms of the anomaly polynomial of the parent 6d theory. Our observations resolve an apparent contradiction associated with