Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf18b02

Browse files
committed
Minor removal of redundant code
1 parent e931344 commit bf18b02

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/core/option.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,17 +2034,17 @@ def _basicOptionValidation():
20342034
errMsg = "value for option '--risk' must be an integer value from range [1, 3]"
20352035
raise SqlmapSyntaxException(errMsg)
20362036

2037-
if conf.limitStart is not None and isinstance(conf.limitStart, int) and conf.limitStart > 0 and \
2038-
conf.limitStop is not None and isinstance(conf.limitStop, int) and conf.limitStop < conf.limitStart:
2037+
if isinstance(conf.limitStart, int) and conf.limitStart > 0 and \
2038+
isinstance(conf.limitStop, int) and conf.limitStop < conf.limitStart:
20392039
errMsg = "value for option '--start' (limitStart) must be smaller or equal than value for --stop (limitStop) option"
20402040
raise SqlmapSyntaxException(errMsg)
20412041

2042-
if conf.firstChar is not None and isinstance(conf.firstChar, int) and conf.firstChar > 0 and \
2043-
conf.lastChar is not None and isinstance(conf.lastChar, int) and conf.lastChar < conf.firstChar:
2042+
if isinstance(conf.firstChar, int) and conf.firstChar > 0 and \
2043+
isinstance(conf.lastChar, int) and conf.lastChar < conf.firstChar:
20442044
errMsg = "value for option '--first' (firstChar) must be smaller than or equal to value for --last (lastChar) option"
20452045
raise SqlmapSyntaxException(errMsg)
20462046

2047-
if conf.cpuThrottle is not None and isinstance(conf.cpuThrottle, int) and (conf.cpuThrottle > 100 or conf.cpuThrottle < 0):
2047+
if isinstance(conf.cpuThrottle, int) and (conf.cpuThrottle > 100 or conf.cpuThrottle < 0):
20482048
errMsg = "value for option '--cpu-throttle' (cpuThrottle) must be in range [0,100]"
20492049
raise SqlmapSyntaxException(errMsg)
20502050

lib/request/connect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def getPage(**kwargs):
191191
the target URL page content
192192
"""
193193

194-
if conf.delay is not None and isinstance(conf.delay, (int, float)) and conf.delay > 0:
194+
if isinstance(conf.delay, (int, float)) and conf.delay > 0:
195195
time.sleep(conf.delay)
196196
elif conf.cpuThrottle:
197197
cpuThrottle(conf.cpuThrottle)

0 commit comments

Comments
 (0)