def gcd(a, b):
"""Fallback implementation when Crypto is missing, and fractions does
not exist (Python 2.5)
"""
if b > a:
a, b = b, a
c = a % b
return b if c == 0 else gcd(c, b)