diff -cr ../Python-1.5.orig/Lib/re.py ./Lib/re.py *** ../Python-1.5.orig/Lib/re.py Mon Dec 8 18:12:00 1997 --- Lib/re.py Thu Mar 12 19:48:21 1998 *************** *** 259,269 **** def groups(self): "Return a tuple containing all subgroups of the match object" ! ! # If _num_regs==1, we don't want to call self.group with an ! # empty tuple. ! if self.re._num_regs == 1: return () ! return apply(self.group, tuple(range(1, self.re._num_regs) ) ) def group(self, *groups): "Return one or more groups of the match." --- 260,272 ---- def groups(self): "Return a tuple containing all subgroups of the match object" ! result = [] ! for g in range(1, self.re._num_regs): ! if (self.regs[g][0] == -1) or (self.regs[g][1] == -1): ! result.append(None) ! else: ! result.append(self.string[self.regs[g][0]:self.regs[g][1]]) ! return tuple(result) def group(self, *groups): "Return one or more groups of the match."