use six to support python 2 and 3

This commit is contained in:
j 2014-09-30 21:04:46 +02:00
commit d4d09b56b6
28 changed files with 1730 additions and 1678 deletions

View file

@ -20,7 +20,7 @@ def toAZ(num):
>>> toAZ(1234567890)
'CYWOQVJ'
"""
if num < 1: raise ValueError, "must supply a positive integer"
if num < 1: raise ValueError("must supply a positive integer")
digits = string.ascii_uppercase
az = ''
while num != 0:
@ -62,7 +62,7 @@ def to26(q):
>>> to26(347485647)
'BDGKMAP'
"""
if q < 0: raise ValueError, "must supply a positive integer"
if q < 0: raise ValueError("must supply a positive integer")
base26 = string.ascii_uppercase
converted = []
while q != 0:
@ -119,7 +119,7 @@ def to32(q):
ValueError: must supply a positive integer
"""
if q < 0: raise ValueError, "must supply a positive integer"
if q < 0: raise ValueError("must supply a positive integer")
letters = "0123456789ABCDEFGHJKMNPQRSTVWXYZ"
converted = []
while q != 0:
@ -206,7 +206,7 @@ def to36(q):
...
ValueError: must supply a positive integer
"""
if q < 0: raise ValueError, "must supply a positive integer"
if q < 0: raise ValueError("must supply a positive integer")
letters = "0123456789abcdefghijklmnopqrstuvwxyz"
converted = []
while q != 0: