This commit is contained in:
Miroslav Stampar 2019-03-28 16:32:46 +01:00
parent 015984a7f2
commit f82f1f912d
2 changed files with 16 additions and 2 deletions

View File

@ -17,7 +17,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
from lib.core.enums import OS
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.3.3.73"
VERSION = "1.3.3.74"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View File

@ -12,6 +12,20 @@ class xrange(object):
Advanced (re)implementation of xrange (supports slice/copy/etc.)
Reference: http://code.activestate.com/recipes/521885-a-pythonic-implementation-of-xrange/
>>> list(xrange(1, 9)) == range(1, 9)
True
>>> list(xrange(8, 0, -16)) == range(8, 0, -16)
True
>>> list(xrange(0, 8, 16)) == range(0, 8, 16)
True
>>> list(xrange(0, 4, 5)) == range(0, 4, 5)
True
>>> list(xrange(4, 0, 3)) == range(4, 0, 3)
True
>>> list(xrange(0, -3)) == range(0, -3)
True
>>> list(xrange(0, 7, 2)) == range(0, 7, 2)
True
>>> foobar = xrange(1, 10)
>>> 7 in foobar
True
@ -60,7 +74,7 @@ class xrange(object):
return self._len()
def _len(self):
return max(0, int((self.stop - self.start) // self.step))
return max(0, 1 + int((self.stop - 1 - self.start) // self.step))
def __contains__(self, value):
return (self.start <= value < self.stop) and (value - self.start) % self.step == 0