mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 06:50:14 +00:00
Dealing with deprecated next()
This commit is contained in:
parent
2c270ed250
commit
1adc66b763
13 changed files with 32 additions and 32 deletions
10
thirdparty/beautifulsoup/beautifulsoup.py
vendored
10
thirdparty/beautifulsoup/beautifulsoup.py
vendored
|
|
@ -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):
|
||||
|
|
|
|||
4
thirdparty/gprof2dot/gprof2dot.py
vendored
4
thirdparty/gprof2dot/gprof2dot.py
vendored
|
|
@ -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)
|
||||
|
|
|
|||
2
thirdparty/multipart/multipartpost.py
vendored
2
thirdparty/multipart/multipartpost.py
vendored
|
|
@ -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)
|
||||
|
|
|
|||
2
thirdparty/odict/odict.py
vendored
2
thirdparty/odict/odict.py
vendored
|
|
@ -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]
|
||||
|
|
|
|||
4
thirdparty/oset/_abc.py
vendored
4
thirdparty/oset/_abc.py
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
2
thirdparty/oset/pyoset.py
vendored
2
thirdparty/oset/pyoset.py
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
4
thirdparty/xdot/xdot.py
vendored
4
thirdparty/xdot/xdot.py
vendored
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue