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

Skip to content

Commit 0bbd7fd

Browse files
committed
Minor update (drei DeprecationWarnings)
1 parent 1a089cc commit 0bbd7fd

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty import six
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.5.54"
21+
VERSION = "1.3.5.55"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

thirdparty/beautifulsoup/beautifulsoup.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,7 @@ def toEncoding(self, s, encoding=None):
449449
s = self.toEncoding(str(s), encoding or "utf8")
450450
return s
451451

452-
BARE_AMPERSAND_OR_BRACKET = re.compile("([<>]|"
453-
+ "&(?!#\d+;|#x[0-9a-fA-F]+;|\w+;)"
454-
+ ")")
452+
BARE_AMPERSAND_OR_BRACKET = re.compile(r"([<>]|&(?!#\d+;|#x[0-9a-fA-F]+;|\w+;))")
455453

456454
def _sub_entity(self, x):
457455
"""Used with a regular expression to substitute the
@@ -574,7 +572,7 @@ def __init__(self, parser, name, attrs=None, parent=None,
574572
# Convert any HTML, XML, or numeric entities in the attribute values.
575573
# Reference: https://github.com/pkrumins/xgoogle/pull/16/commits/3dba1165c436b0d6e5bdbd09e53ca0dbf8a043f8
576574
convert = lambda k_val: (k_val[0],
577-
re.sub("&(#\d+|#x[0-9a-fA-F]+|\w+);",
575+
re.sub(r"&(#\d+|#x[0-9a-fA-F]+|\w+);",
578576
self._convertEntities,
579577
k_val[1]))
580578
self.attrs = map(convert, self.attrs)
@@ -1079,9 +1077,9 @@ class BeautifulStoneSoup(Tag, sgmllib.SGMLParser):
10791077
QUOTE_TAGS = {}
10801078
PRESERVE_WHITESPACE_TAGS = []
10811079

1082-
MARKUP_MASSAGE = [(re.compile('(<[^<>]*)/>'),
1080+
MARKUP_MASSAGE = [(re.compile(r'(<[^<>]*)/>'),
10831081
lambda x: x.group(1) + ' />'),
1084-
(re.compile('<!\s+([^<>]*)>'),
1082+
(re.compile(r'<!\s+([^<>]*)>'),
10851083
lambda x: '<!' + x.group(1) + '>')
10861084
]
10871085

@@ -1590,7 +1588,7 @@ def __init__(self, *args, **kwargs):
15901588
NESTABLE_LIST_TAGS, NESTABLE_TABLE_TAGS)
15911589

15921590
# Used to detect the charset in a META tag; see start_meta
1593-
CHARSET_RE = re.compile("((^|;)\s*charset=)([^;]*)", re.M)
1591+
CHARSET_RE = re.compile(r"((^|;)\s*charset=)([^;]*)", re.M)
15941592

15951593
def start_meta(self, attrs):
15961594
"""Beautiful Soup can detect a charset included in a META tag,
@@ -1934,9 +1932,9 @@ def _detectEncoding(self, xml_data, isHTML=False):
19341932
except:
19351933
xml_encoding_match = None
19361934
xml_encoding_match = re.compile(
1937-
'^<\?.*encoding=[\'"](.*?)[\'"].*\?>').match(xml_data)
1935+
r'^<\?.*encoding=[\'"](.*?)[\'"].*\?>').match(xml_data)
19381936
if not xml_encoding_match and isHTML:
1939-
regexp = re.compile('<\s*meta[^>]+charset=([^>]*?)[;\'">]', re.I)
1937+
regexp = re.compile(r'<\s*meta[^>]+charset=([^>]*?)[;\'">]', re.I)
19401938
xml_encoding_match = regexp.search(xml_data)
19411939
if xml_encoding_match is not None:
19421940
xml_encoding = xml_encoding_match.groups()[0].lower()

thirdparty/colorama/ansitowin32.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class AnsiToWin32(object):
4646
sequences from the text, and if outputting to a tty, will convert them into
4747
win32 function calls.
4848
'''
49-
ANSI_CSI_RE = re.compile('\001?\033\[((?:\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer
50-
ANSI_OSC_RE = re.compile('\001?\033\]((?:.|;)*?)(\x07)\002?') # Operating System Command
49+
ANSI_CSI_RE = re.compile('\001?\033\\[((?:\\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer
50+
ANSI_OSC_RE = re.compile('\001?\033\\]((?:.|;)*?)(\x07)\002?') # Operating System Command
5151

5252
def __init__(self, wrapped, convert=None, strip=None, autoreset=False):
5353
# The wrapped stream (normally sys.stdout or sys.stderr)

thirdparty/gprof2dot/gprof2dot.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ class CallgrindParser(LineParser):
10421042
- http://valgrind.org/docs/manual/cl-Format.html
10431043
"""
10441044

1045-
_call_re = re.compile('^calls=\s*(\d+)\s+((\d+|\+\d+|-\d+|\*)\s+)+$')
1045+
_call_re = re.compile(r'^calls=\s*(\d+)\s+((\d+|\+\d+|-\d+|\*)\s+)+$')
10461046

10471047
def __init__(self, infile):
10481048
LineParser.__init__(self, infile)
@@ -1204,7 +1204,7 @@ def parse_association_spec(self):
12041204

12051205
return True
12061206

1207-
_position_re = re.compile('^(?P<position>c?(?:ob|fl|fi|fe|fn))=\s*(?:\((?P<id>\d+)\))?(?:\s*(?P<name>.+))?')
1207+
_position_re = re.compile(r'^(?P<position>c?(?:ob|fl|fi|fe|fn))=\s*(?:\((?P<id>\d+)\))?(?:\s*(?P<name>.+))?')
12081208

12091209
_position_table_map = {
12101210
'ob': 'ob',
@@ -2071,7 +2071,8 @@ def __init__(self, *filename):
20712071
self.profile = Profile()
20722072
self.function_ids = {}
20732073

2074-
def get_function_name(self, (filename, line, name)):
2074+
def get_function_name(self, args):
2075+
filename, line, name = args
20752076
module = os.path.splitext(filename)[0]
20762077
module = os.path.basename(module)
20772078
return "%s:%d:%s" % (module, line, name)
@@ -2406,7 +2407,8 @@ def id(self, id):
24062407
raise TypeError
24072408
self.write(s)
24082409

2409-
def color(self, (r, g, b)):
2410+
def color(self, args):
2411+
r, g, b = args
24102412

24112413
def float2int(f):
24122414
if f <= 0.0:

0 commit comments

Comments
 (0)