minor fix

This commit is contained in:
Miroslav Stampar 2012-06-15 06:22:44 +00:00
parent 76584ff0fa
commit 76c873a222
2 changed files with 3 additions and 3 deletions

View File

@ -420,7 +420,7 @@ class Agent:
fieldsToCastStr = fieldsSelectFrom.groups()[0] fieldsToCastStr = fieldsSelectFrom.groups()[0]
elif fieldsSelect: elif fieldsSelect:
fieldsToCastStr = fieldsSelect.groups()[0] fieldsToCastStr = fieldsSelect.groups()[0]
elif fieldsNoSelect: else:
fieldsToCastStr = fieldsNoSelect fieldsToCastStr = fieldsNoSelect
# Function # Function

View File

@ -105,14 +105,14 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
else: else:
expressionUnescaped = unescaper.unescape(expression) expressionUnescaped = unescaper.unescape(expression)
if length and not isinstance(length, int) and length.isdigit(): if length and isinstance(length, basestring) and length.isdigit():
length = int(length) length = int(length)
if length == 0: if length == 0:
return 0, "" return 0, ""
if lastChar > 0 and length > ( lastChar - firstChar ): if lastChar > 0 and length > ( lastChar - firstChar ):
length = ( lastChar - firstChar ) length = lastChar - firstChar
showEta = conf.eta and isinstance(length, int) showEta = conf.eta and isinstance(length, int)
numThreads = min(conf.threads, length) numThreads = min(conf.threads, length)