Implement and apply PEP 322, reverse iteration

This commit is contained in:
Raymond Hettinger 2003-11-06 14:06:48 +00:00
parent f607fc5395
commit 85c20a41df
12 changed files with 198 additions and 9 deletions

View file

@ -201,7 +201,7 @@ def _dist_try_harder(distname,version,id):
if os.path.isdir('/usr/lib/setup'):
# Check for slackware verson tag file (thanks to Greg Andruk)
verfiles = os.listdir('/usr/lib/setup')
for n in range(len(verfiles)-1, -1, -1):
for n in reversed(xrange(len(verfiles))):
if verfiles[n][:14] != 'slack-version-':
del verfiles[n]
if verfiles: