Dealing with deprecated next()

This commit is contained in:
Miroslav Stampar 2019-01-22 02:47:06 +01:00
parent 2c270ed250
commit 1adc66b763
13 changed files with 32 additions and 32 deletions

View File

@ -313,7 +313,7 @@ def _setRequestFromFile():
infoMsg = "parsing second-order HTTP request from '%s'" % conf.secondReq
logger.info(infoMsg)
target = parseRequestFile(conf.secondReq, False).next()
target = next(parseRequestFile(conf.secondReq, False))
kb.secondReq = target
def _setCrawler():

View File

@ -19,7 +19,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.1.64"
VERSION = "1.3.1.65"
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

@ -68,7 +68,7 @@ class Wordlist(object):
while True:
self.counter += 1
try:
retVal = self.iter.next().rstrip()
retVal = next(self.iter).rstrip()
except zipfile.error as ex:
errMsg = "something appears to be wrong with "
errMsg += "the file '%s' ('%s'). Please make " % (self.current, getSafeExString(ex))
@ -76,7 +76,7 @@ class Wordlist(object):
raise SqlmapInstallationException(errMsg)
except StopIteration:
self.adjust()
retVal = self.iter.next().rstrip()
retVal = next(self.iter).rstrip()
if not self.proc_count or self.counter % self.proc_count == self.proc_id:
break
return retVal

View File

@ -405,7 +405,7 @@ def errorUse(expression, dump=False):
with kb.locks.limit:
try:
threadData.shared.counter += 1
num = threadData.shared.limits.next()
num = next(threadData.shared.limits)
except StopIteration:
break

View File

@ -313,7 +313,7 @@ def unionUse(expression, unpack=True, dump=False):
with kb.locks.limit:
try:
threadData.shared.counter += 1
num = threadData.shared.limits.next()
num = next(threadData.shared.limits)
except StopIteration:
break

View File

@ -370,7 +370,7 @@ class PageElement(object):
g = generator()
while True:
try:
i = g.next()
i = next(g)
except StopIteration:
break
if i:
@ -470,7 +470,7 @@ class NavigableString(unicode, PageElement):
if attr == 'string':
return self
else:
raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__.__name__, attr)
raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__.__name__, attr))
def __unicode__(self):
return str(self).decode(DEFAULT_OUTPUT_ENCODING)
@ -668,7 +668,7 @@ class Tag(PageElement):
return self.find(tag[:-3])
elif tag.find('__') != 0:
return self.find(tag)
raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__, tag)
raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__, tag))
def __eq__(self, other):
"""Returns true iff this tag has the same name, the same attributes,
@ -974,8 +974,8 @@ class SoupStrainer:
if self._matches(markup, self.text):
found = markup
else:
raise Exception, "I don't know how to match against a %s" \
% markup.__class__
raise Exception("I don't know how to match against a %s" \
% markup.__class__)
return found
def _matches(self, markup, matchAgainst):

View File

@ -732,7 +732,7 @@ class XmlParser(Parser):
self.consume()
def consume(self):
self.token = self.tokenizer.next()
self.token = next(self.tokenizer)
def match_element_start(self, name):
return self.token.type == XML_ELEMENT_START and self.token.name_or_data == name
@ -1719,7 +1719,7 @@ class XPerfParser(Parser):
lineterminator = '\r\n',
quoting = csv.QUOTE_NONE)
it = iter(reader)
row = reader.next()
row = next(reader)
self.parse_header(row)
for row in it:
self.parse_row(row)

View File

@ -59,7 +59,7 @@ class MultipartPostHandler(urllib2.BaseHandler):
v_vars.append((key, value))
except TypeError:
systype, value, traceback = sys.exc_info()
raise SqlmapDataException, "not a valid non-string sequence or mapping object", traceback
raise SqlmapDataException("not a valid non-string sequence or mapping object '%s'" % traceback)
if len(v_files) == 0:
data = urllib.urlencode(v_vars, doseq)

View File

@ -609,7 +609,7 @@ class _OrderedDict(dict):
TypeError: pop expected at most 2 arguments, got 3
"""
if len(args) > 1:
raise TypeError, ('pop expected at most 2 arguments, got %s' %
raise TypeError('pop expected at most 2 arguments, got %s' %
(len(args) + 1))
if key in self:
val = self[key]

View File

@ -364,7 +364,7 @@ class MutableSet(Set):
"""Return the popped value. Raise KeyError if empty."""
it = iter(self)
try:
value = it.next()
value = next(it)
except StopIteration:
raise KeyError
self.discard(value)
@ -453,7 +453,7 @@ class OrderedSet(MutableSet):
def pop(self, last=True):
if not self:
raise KeyError('set is empty')
key = reversed(self).next() if last else iter(self).next()
key = next(reversed(self)) if last else next(iter(self))
self.discard(key)
return key

View File

@ -62,7 +62,7 @@ class OrderedSet(MutableSet):
def pop(self, last=True):
if not self:
raise KeyError('set is empty')
key = reversed(self).next() if last else iter(self).next()
key = next(reversed(self)) if last else next(iter(self))
self.discard(key)
return key

View File

@ -897,7 +897,7 @@ class Parser:
def __init__(self, lexer):
self.lexer = lexer
self.lookahead = self.lexer.next()
self.lookahead = next(self.lexer)
def match(self, type):
if self.lookahead.type != type:
@ -913,7 +913,7 @@ class Parser:
def consume(self):
token = self.lookahead
self.lookahead = self.lexer.next()
self.lookahead = next(self.lexer)
return token

View File

@ -42,14 +42,14 @@ fd5403505f76eee6829c06b9342e269c lib/core/dump.py
fb6be55d21a70765e35549af2484f762 lib/core/__init__.py
18c896b157b03af716542e5fe9233ef9 lib/core/log.py
fa9f24e88c81a6cef52da3dd5e637010 lib/core/optiondict.py
3c5c2c63e67b40ca8ae9b1ffa8d7f77d lib/core/option.py
bf83a5194e5490273a64a35ae5eacf69 lib/core/option.py
fe370021c6bc99daf44b2bfc0d1effb3 lib/core/patch.py
4cfda3735871cd59b213470a0bbc8c3a lib/core/profiling.py
5e2c16a8e2daee22dd545df13386e7a3 lib/core/readlineng.py
7d8a22c582ad201f65b73225e4456170 lib/core/replication.py
3179d34f371e0295dd4604568fb30bcd lib/core/revision.py
d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
10790114fe549cd3e2eaf035e2594c95 lib/core/settings.py
931c1e5b6236016d536eb6f70a4a669e lib/core/settings.py
4483b4a5b601d8f1c4281071dff21ecc lib/core/shell.py
10fd19b0716ed261e6d04f311f6f527c lib/core/subprocessng.py
9c7b5c6397fb3da33e7a4d7876d159c6 lib/core/target.py
@ -57,7 +57,7 @@ d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
203d2082929b4ac5454605c8c7c800a9 lib/core/threads.py
2c263c8610667fdc593c50a35ab20f57 lib/core/unescaper.py
ff45c74515fecc95277f7b9ad945f17c lib/core/update.py
b40f4c20a38729bb4933b8221665f106 lib/core/wordlist.py
5b3f08208be0579356f78ce5805d37b2 lib/core/wordlist.py
fb6be55d21a70765e35549af2484f762 lib/__init__.py
4881480d0c1778053908904e04570dc3 lib/parse/banner.py
87a1d50411e74cd0afb2d1bed30f59d4 lib/parse/cmdline.py
@ -96,11 +96,11 @@ fb6be55d21a70765e35549af2484f762 lib/techniques/dns/__init__.py
ea48db4c48276d7d0e71aa467c0c523f lib/techniques/dns/test.py
13a80dfa26c53246d4a353c11c082d5d lib/techniques/dns/use.py
fb6be55d21a70765e35549af2484f762 lib/techniques/error/__init__.py
62d64b853bbc9353843376fff3a7f48d lib/techniques/error/use.py
7b58029a51b9bf989d18e5bb6e99635c lib/techniques/error/use.py
fb6be55d21a70765e35549af2484f762 lib/techniques/__init__.py
fb6be55d21a70765e35549af2484f762 lib/techniques/union/__init__.py
9d9a6148f10693aaab5fac1273d981d4 lib/techniques/union/test.py
d32988e13713417286ab83a00856858e lib/techniques/union/use.py
e141fb96f2a136bafd6bb2350f02d33b lib/techniques/union/use.py
78cd3133349e9cfdcc6b3512c7d5ce36 lib/utils/api.py
544dee96e782560fe4355cbf6ee19b8c lib/utils/brute.py
b27421eb57cea711050135f84be99258 lib/utils/crawler.py
@ -294,7 +294,7 @@ fc571c746951a5306591e04f70ddc46e tamper/versionedmorekeywords.py
d39ce1f99e268dc7f92b602656f49461 tamper/xforwardedfor.py
b1c02296b4e3b0ebaa58b9dcd914cbf4 thirdparty/ansistrm/ansistrm.py
d41d8cd98f00b204e9800998ecf8427e thirdparty/ansistrm/__init__.py
8e775c25bc9e84891ad6fcb4f0005c23 thirdparty/beautifulsoup/beautifulsoup.py
4dd01a6ac22e44e445330500e2a7fb1a thirdparty/beautifulsoup/beautifulsoup.py
cb2e1fe7c404dff41a2ae9132828f532 thirdparty/beautifulsoup/__init__.py
ff54a1d98f0ab01ba7b58b068d2ebd26 thirdparty/bottle/bottle.py
4528e6a7bb9341c36c425faf40ef32c3 thirdparty/bottle/__init__.py
@ -346,7 +346,7 @@ ad3d022d4591aee80f7391248d722413 thirdparty/colorama/win32.py
cdd682cbf77137ef4253b77a95ed9bd8 thirdparty/colorama/winterm.py
be7eac2e6cfb45c5e297ec5eee66e747 thirdparty/fcrypt/fcrypt.py
e00542d22ffa8d8ac894c210f38454be thirdparty/fcrypt/__init__.py
2f94ddd6ada38e4091e819568e7c4b7c thirdparty/gprof2dot/gprof2dot.py
f495039e29b2ebe431fa0a31d3c564fa thirdparty/gprof2dot/gprof2dot.py
855372c870a23d46683f8aa39d75f6a1 thirdparty/gprof2dot/__init__.py
d41d8cd98f00b204e9800998ecf8427e thirdparty/__init__.py
e3b18f925d125bd17c7e7a7ec0b4b85f thirdparty/keepalive/__init__.py
@ -354,12 +354,12 @@ e0c6a936506bffeed53ce106ec15942d thirdparty/keepalive/keepalive.py
d41d8cd98f00b204e9800998ecf8427e thirdparty/magic/__init__.py
bf318e0abbe6b2e1a167a233db7f744f thirdparty/magic/magic.py
d41d8cd98f00b204e9800998ecf8427e thirdparty/multipart/__init__.py
03c8abc17b228e59bcfda1f11a9137e0 thirdparty/multipart/multipartpost.py
82432cb4ef575aa16900ba221cc1dc98 thirdparty/multipart/multipartpost.py
3e502b04f3849afbb7f0e13b5fd2b5c1 thirdparty/odict/__init__.py
127fe54fdb9b13fdac93c8fc9c9cad5e thirdparty/odict/odict.py
08801ea0ba9ae22885275ef65d3ee9dc thirdparty/oset/_abc.py
4174fad6be204761db349032341b7582 thirdparty/odict/odict.py
0105f1734f326704d2d68839084ca661 thirdparty/oset/_abc.py
54a861de0f08bb80c2e8846579ec83bd thirdparty/oset/__init__.py
179f0c584ef3fb39437bdb6e15d9c867 thirdparty/oset/pyoset.py
6c79e6d14e031beebe6de127b53c7c93 thirdparty/oset/pyoset.py
94a4abc0fdac64ef0661b82aff68d791 thirdparty/prettyprint/__init__.py
ff80a22ee858f5331b0c088efa98b3ff thirdparty/prettyprint/prettyprint.py
5c70f8e5f7353aedc6d8d21d4fb72b37 thirdparty/pydes/__init__.py
@ -371,7 +371,7 @@ d97198005a387a9d23916c616620ef7f thirdparty/termcolor/termcolor.py
bf55909ad163b58236e44b86e8441b26 thirdparty/wininetpton/__init__.py
a44e7cf30f2189b2fbdb635b310cdc0c thirdparty/wininetpton/win_inet_pton.py
855372c870a23d46683f8aa39d75f6a1 thirdparty/xdot/__init__.py
593473084228b63a12318d812e50f1e2 thirdparty/xdot/xdot.py
fb6c71a25d5a93bf20ab99fe4e31e0dd thirdparty/xdot/xdot.py
08c706478fad0acba049d0e32cbb6411 udf/mysql/linux/32/lib_mysqludf_sys.so_
1501fa7150239b18acc0f4a9db2ebc0d udf/mysql/linux/64/lib_mysqludf_sys.so_
70d83edb90c4a20bd95eb62f71c99bd0 udf/mysql/windows/32/lib_mysqludf_sys.dll_