##// END OF EJS Templates
Fixed python2.3 incompatibility (rsplit) in qpush/qpop with index.
Thomas Arendsen Hein -
r3082:bed7cb83 default
parent child Browse files
Show More
@@ -757,25 +757,25 b' class queue:'
757 # return any partial match made above
757 # return any partial match made above
758 if res:
758 if res:
759 return res
759 return res
760 minus = patch.rsplit('-', 1)
760 minus = patch.rfind('-')
761 if len(minus) > 1:
761 if minus >= 0:
762 res = partial_name(minus[0])
762 res = partial_name(patch[:minus])
763 if res:
763 if res:
764 i = self.series.index(res)
764 i = self.series.index(res)
765 try:
765 try:
766 off = int(minus[1] or 1)
766 off = int(patch[minus+1:] or 1)
767 except(ValueError, OverflowError):
767 except(ValueError, OverflowError):
768 pass
768 pass
769 else:
769 else:
770 if i - off >= 0:
770 if i - off >= 0:
771 return self.series[i - off]
771 return self.series[i - off]
772 plus = patch.rsplit('+', 1)
772 plus = patch.rfind('+')
773 if len(plus) > 1:
773 if plus >= 0:
774 res = partial_name(plus[0])
774 res = partial_name(patch[:plus])
775 if res:
775 if res:
776 i = self.series.index(res)
776 i = self.series.index(res)
777 try:
777 try:
778 off = int(plus[1] or 1)
778 off = int(patch[plus+1:] or 1)
779 except(ValueError, OverflowError):
779 except(ValueError, OverflowError):
780 pass
780 pass
781 else:
781 else:
General Comments 0
You need to be logged in to leave comments. Login now