fix python 2/3 compatibility for xrange->range

This commit is contained in:
km4yri 2017-01-02 19:18:21 -05:00
parent c2c6dbe541
commit 7cf3ddf770
3 changed files with 19 additions and 3 deletions

View file

@ -1,7 +1,12 @@
#!/usr/bin/env python
from __future__ import division
from builtins import range # python 2/3 compatibility
try: # python 2/3 compatibility
xrange # will fail in python 3
except NameError:
pass
else:
range = xrange
from pysstv.sstv import byte_to_freq, FREQ_BLACK, FREQ_WHITE, FREQ_VIS_START
from pysstv.grayscale import GrayscaleSSTV
from itertools import chain

View file

@ -1,7 +1,13 @@
#!/usr/bin/env python
from __future__ import division
from builtins import range # python 2/3 compatibility
try: # python 2/3 compatibility
xrange # will fail in python 3
except NameError:
pass
else:
range = xrange
from pysstv.sstv import SSTV, byte_to_freq

View file

@ -12,8 +12,13 @@ try:
import itertools.izip as zip # python 2
except ImportError:
pass # python 3
from builtins import range # python 2/3 compatibility
from itertools import cycle, chain
try: # python 2/3 compatibility
xrange # will fail in python 3
except NameError:
pass
else:
range = xrange
from array import array
import wave