[pacman-dev] rankmirrors update: better keyboardinterrupt handling FIX
James Rosten
seinfeld90 at gmail.com
Sun Mar 11 21:22:19 EDT 2007
This is a patch to fix a problem caused by the original patch. Just apply this
after applying the first patch.
~ Jamie / yankees26
Signed-off-by: James Rosten <seinfeld90 at gmail.com>
--- OLD/scripts/rankmirrors 62cb4a9d8edf7abad367ae2c1c9b7147b24402d1
+++ NEW/scripts/rankmirrors 51d5ca7e7ceb272886b3101f0c26fd03a1bbb7eb
@@ -79,10 +79,10 @@ def printResults(servers, time, verbose,
print
print ' Servers sorted by time (seconds):'
for i in items[0:numToShow]:
- try:
- print i[0], ':', "%.2f" % i[1]
- except:
+ if i[1] == 'timeout' or i[1] == 'unreachable':
print i[0], ':', i[1]
+ else:
+ print i[0], ':', "%.2f" % i[1]
else:
for i in items[0:numToShow]:
print 'Server =', i[0]
@@ -91,10 +91,10 @@ def printResults(servers, time, verbose,
print
print ' Servers sorted by time (seconds):'
for i in items:
- try:
- print "%.2f" % i[0], ':', i[1]
- except:
- print i[0], ':', i[1]
+ if i[1] == 'timeout' or i[1] == 'unreachable':
+ print i[0], ':', i[1]
+ else:
+ print i[0], ':', "%.2f" % i[1]
else:
for i in items:
print ' Server =', i[0]
More information about the pacman-dev
mailing list