@pernici It looks like this introduced a failure in @asmeurer's bot: https://github.com/sympy/sympy/pull/2244#issuecomment-23548182 (see the python 2.6 and 2.7 logs). In 2.7:

```
  File "/tmp/sympy-bot-tmpnRMqWt/sympy/sympy/ntheory/tests/test_ntheory.py", line 492, in test_residue
    assert pow(next(it), 2, p) == a
  File "sympy/ntheory/residue_ntheory.py", line 340, in sqrt_mod_iter
    for vx in _product(*v):
  File "sympy/ntheory/residue_ntheory.py", line 274, in _product
    i, cur_val[p] = next(inf_iters[p])
  File "sympy/ntheory/residue_ntheory.py", line 509, in _iter2
    for i in xrange(0, 2**n, 2**(n - m)):
OverflowError: Python int too large to convert to C long
```

and in 2.6:

```
OverflowError: long int too large to convert to int
```