Permalink
Browse files

Avoid those pesky 'list index out of range' exceptions

  • Loading branch information...
1 parent 4b9f28e commit 1d8604ec726c3b666f0f0b1a1d8d7b1e166879f2 @jpm jpm committed Aug 1, 2004
Showing with 4 additions and 4 deletions.
  1. +4 −4 papercut.py
View
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# Copyright (c) 2002 Joao Prado Maia. See the LICENSE file for more information.
-# $Id: papercut.py,v 1.90 2004-08-01 21:10:10 jpm Exp $
+# $Id: papercut.py,v 1.91 2004-08-01 21:39:51 jpm Exp $
import SocketServer
import sys
import os
@@ -515,7 +515,7 @@ def do_XOVER(self):
overviews = backend.get_XOVER(self.selected_group, self.tokens[1], self.tokens[1])
else:
ranges = self.tokens[1].split('-')
- if ranges[1] == '':
+ if len(ranges) == 1:
# this is a start-everything style of XOVER
overviews = backend.get_XOVER(self.selected_group, ranges[0])
else:
@@ -554,7 +554,7 @@ def do_XPAT(self):
return
else:
ranges = self.tokens[2].split('-')
- if ranges[1] == '':
+ if len(ranges) == 1:
overviews = backend.get_XPAT(self.selected_group, self.tokens[1], self.tokens[3], ranges[0])
else:
overviews = backend.get_XPAT(self.selected_group, self.tokens[1], self.tokens[3], ranges[0], ranges[1])
@@ -681,7 +681,7 @@ def do_XHDR(self):
info = backend.get_XHDR(self.selected_group, self.tokens[1], 'unique', (self.tokens[2]))
else:
ranges = self.tokens[2].split('-')
- if ranges[1] == '':
+ if len(ranges) == 1:
info = backend.get_XHDR(self.selected_group, self.tokens[1], 'range', (ranges[0]))
else:
info = backend.get_XHDR(self.selected_group, self.tokens[1], 'range', (ranges[0], ranges[1]))

0 comments on commit 1d8604e

Please sign in to comment.