diff options
author | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-09-21 12:49:33 +0000 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-09-21 12:49:33 +0000 |
commit | fa8ea8ef3cc8a7433d496e3dc54d56a0bd2ffd06 (patch) | |
tree | 90ba609a1b93428a62c936ae321d485f519b4f85 /pym/portage | |
parent | c581522b4fcac9edae8e494e213c654612ad4490 (diff) | |
download | portage-fa8ea8ef3cc8a7433d496e3dc54d56a0bd2ffd06.tar.gz portage-fa8ea8ef3cc8a7433d496e3dc54d56a0bd2ffd06.tar.bz2 portage-fa8ea8ef3cc8a7433d496e3dc54d56a0bd2ffd06.zip |
Use range() instead of xrange() for compatibility with Python 3.
(2to3-3.1 -f xrange -nw ${FILES})
svn path=/main/trunk/; revision=14317
Diffstat (limited to 'pym/portage')
-rw-r--r-- | pym/portage/__init__.py | 4 | ||||
-rw-r--r-- | pym/portage/cache/metadata.py | 2 | ||||
-rw-r--r-- | pym/portage/cache/template.py | 4 | ||||
-rw-r--r-- | pym/portage/dbapi/bintree.py | 2 | ||||
-rw-r--r-- | pym/portage/getbinpkg.py | 2 | ||||
-rw-r--r-- | pym/portage/manifest.py | 2 | ||||
-rw-r--r-- | pym/portage/output.py | 4 | ||||
-rw-r--r-- | pym/portage/process.py | 2 | ||||
-rw-r--r-- | pym/portage/proxy/lazyimport.py | 2 | ||||
-rw-r--r-- | pym/portage/tests/xpak/test_decodeint.py | 2 |
10 files changed, 13 insertions, 13 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 6fce50b2c..d4b44d29a 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -2728,7 +2728,7 @@ class config(object): x_split = x.split('_') if len(x_split) == 1: continue - for i in xrange(len(x_split) - 1): + for i in range(len(x_split) - 1): k = '_'.join(x_split[:i+1]) if k in use_expand_split: v = use_expand_iuses.get(k) @@ -8208,7 +8208,7 @@ def getmaskingreason(mycpv, metadata=None, settings=None, portdb=None, return_lo comment_valid = -1 for pmask in pmasklists: pmask_filename = os.path.join(pmask[0], "package.mask") - for i in xrange(len(pmask[1])): + for i in range(len(pmask[1])): l = pmask[1][i].strip() if l == "": comment = "" diff --git a/pym/portage/cache/metadata.py b/pym/portage/cache/metadata.py index 2b8047d43..8518c0e69 100644 --- a/pym/portage/cache/metadata.py +++ b/pym/portage/cache/metadata.py @@ -87,7 +87,7 @@ class database(flat_hash.database): for k in self.auxdbkey_order: new_content.append(values.get(k, '')) new_content.append('\n') - for i in xrange(magic_line_count - len(self.auxdbkey_order)): + for i in range(magic_line_count - len(self.auxdbkey_order)): new_content.append('\n') new_content = ''.join(new_content) new_content = _unicode_encode(new_content, diff --git a/pym/portage/cache/template.py b/pym/portage/cache/template.py index 7fc4e9495..f4e9dfb8d 100644 --- a/pym/portage/cache/template.py +++ b/pym/portage/cache/template.py @@ -221,11 +221,11 @@ def reconstruct_eclasses(cpv, eclass_string): d={} try: if eclasses[1].isdigit(): - for x in xrange(0, len(eclasses), 2): + for x in range(0, len(eclasses), 2): d[eclasses[x]] = ("", long(eclasses[x + 1])) else: # The old format contains paths that will be discarded. - for x in xrange(0, len(eclasses), 3): + for x in range(0, len(eclasses), 3): d[eclasses[x]] = (eclasses[x + 1], long(eclasses[x + 2])) except IndexError: raise cache_errors.CacheCorruption(cpv, diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 3728e3e9f..c37242419 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -894,7 +894,7 @@ class binarytree(object): # If found, remove package(s) with duplicate path. path = d.get("PATH", "") - for i in xrange(len(pkgindex.packages) - 1, -1, -1): + for i in range(len(pkgindex.packages) - 1, -1, -1): d2 = pkgindex.packages[i] if path and path == d2.get("PATH"): # Handle path collisions in $PKGDIR/All diff --git a/pym/portage/getbinpkg.py b/pym/portage/getbinpkg.py index 2003fdbdc..5d3864fd1 100644 --- a/pym/portage/getbinpkg.py +++ b/pym/portage/getbinpkg.py @@ -648,7 +648,7 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache= cache_stats.update() metadata[baseurl]["modified"] = 1 myid = None - for retry in xrange(3): + for retry in range(3): try: myid = file_get_metadata( "/".join((baseurl.rstrip("/"), x.lstrip("/"))), diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py index e60850e5f..cd2609c3b 100644 --- a/pym/portage/manifest.py +++ b/pym/portage/manifest.py @@ -239,7 +239,7 @@ class Manifest(object): f.close() if len(oldentries) == len(myentries): update_manifest = False - for i in xrange(len(oldentries)): + for i in range(len(oldentries)): if oldentries[i] != myentries[i]: update_manifest = True break diff --git a/pym/portage/output.py b/pym/portage/output.py index 570de78e9..5f310d300 100644 --- a/pym/portage/output.py +++ b/pym/portage/output.py @@ -77,7 +77,7 @@ def color(fg, bg="default", attr=["normal"]): ansi_codes = [] -for x in xrange(30, 38): +for x in range(30, 38): ansi_codes.append("%im" % x) ansi_codes.append("%i;01m" % x) @@ -85,7 +85,7 @@ rgb_ansi_colors = ['0x000000', '0x555555', '0xAA0000', '0xFF5555', '0x00AA00', '0x55FF55', '0xAA5500', '0xFFFF55', '0x0000AA', '0x5555FF', '0xAA00AA', '0xFF55FF', '0x00AAAA', '0x55FFFF', '0xAAAAAA', '0xFFFFFF'] -for x in xrange(len(rgb_ansi_colors)): +for x in range(len(rgb_ansi_colors)): codes[rgb_ansi_colors[x]] = esc_seq + ansi_codes[x] del x diff --git a/pym/portage/process.py b/pym/portage/process.py index d24b6f28a..b49f061f1 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -35,7 +35,7 @@ if os.path.isdir("/proc/%i/fd" % os.getpid()): if fd.isdigit()) else: def get_open_fds(): - return xrange(max_fd_limit) + return range(max_fd_limit) sandbox_capable = (os.path.isfile(SANDBOX_BINARY) and os.access(SANDBOX_BINARY, os.X_OK)) diff --git a/pym/portage/proxy/lazyimport.py b/pym/portage/proxy/lazyimport.py index 77e80e02e..62428543e 100644 --- a/pym/portage/proxy/lazyimport.py +++ b/pym/portage/proxy/lazyimport.py @@ -137,7 +137,7 @@ def lazyimport(scope, *args): components = name.split('.') parent_scope = scope - for i in xrange(len(components)): + for i in range(len(components)): alias = components[i] if i < len(components) - 1: parent_name = ".".join(components[:i+1]) diff --git a/pym/portage/tests/xpak/test_decodeint.py b/pym/portage/tests/xpak/test_decodeint.py index 27e8ab7cf..b949b031d 100644 --- a/pym/portage/tests/xpak/test_decodeint.py +++ b/pym/portage/tests/xpak/test_decodeint.py @@ -10,7 +10,7 @@ class testDecodeIntTestCase(TestCase): def testDecodeInt(self): - for n in xrange(1000): + for n in range(1000): self.assertEqual(decodeint(encodeint(n)), n) for n in (2 ** 32 - 1,): |