Fix testing for positiveInt and nonNegativeInt.

This commit is contained in:
James Vega 2004-10-06 04:32:03 +00:00
parent 23f4dc2d0f
commit edc698e48b
1 changed files with 10 additions and 10 deletions

View File

@ -174,7 +174,7 @@ def getInt(irc, msg, args, state, type='integer', p=None):
if p is not None:
if not p(i):
raise ValueError
state.args.append(_int(args[0]))
state.args.append(i)
del args[0]
except ValueError:
irc.errorInvalid(type, args[0])
@ -195,11 +195,11 @@ def getFloat(irc, msg, args, state):
def getPositiveInt(irc, msg, args, state, *L):
getInt(irc, msg, args, state,
p=lambda i: i<=0, type='positive integer', *L)
p=lambda i: i>0, type='positive integer', *L)
def getNonNegativeInt(irc, msg, args, state, *L):
getInt(irc, msg, args, state,
p=lambda i: i<0, type='non-negative integer', *L)
p=lambda i: i>=0, type='non-negative integer', *L)
def getId(irc, msg, args, state, kind=None):
type = 'id'