[py3] Added Python 3 compatibility for xrange.

This commit is contained in:
Aymeric Augustin 2012-07-20 18:53:11 +02:00
parent ca07fda2ef
commit a84d79f572
32 changed files with 77 additions and 53 deletions

View file

@ -6,7 +6,7 @@ def _resolve_name(name, package, level):
if not hasattr(package, 'rindex'):
raise ValueError("'package' not set to a string")
dot = len(package)
for x in xrange(level, 1, -1):
for x in range(level, 1, -1):
try:
dot = package.rindex('.', 0, dot)
except ValueError: