Fixed a compatibility bug for Python 3 by adding xrange to

compat.py.

The code in tablib/formats/_xls.py used xrange in parsing excel spreadsheets.
xrange is not a builtin for Python 3, so I've added
	xrange = range
in compat.py and imported it in tablib/formats/_xls.py.
This commit is contained in:
Thomas Anthony
2015-05-26 20:06:42 -07:00
parent 24657520e9
commit b3485ec942
3 changed files with 4 additions and 1 deletions
+1
View File
@@ -28,3 +28,4 @@ Patches and Suggestions
- Marc Abramowitz
- Alex Gaynor
- James Douglass
- Tommy Anthony
+2
View File
@@ -37,6 +37,7 @@ if is_py3:
unicode = str
bytes = bytes
basestring = str
xrange = range
else:
from cStringIO import StringIO as BytesIO
@@ -53,3 +54,4 @@ else:
import tablib.packages.dbfpy as dbfpy
unicode = unicode
xrange = xrange
+1 -1
View File
@@ -5,7 +5,7 @@
import sys
from tablib.compat import BytesIO, xlwt, xlrd, XLRDError
from tablib.compat import BytesIO, xlwt, xlrd, XLRDError, xrange
import tablib
title = 'xls'