Skip to content

Commit da86486

Browse files
committed
Couple of minor patches
1 parent dccc837 commit da86486

File tree

8 files changed

+18
-14
lines changed

8 files changed

+18
-14
lines changed

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from thirdparty.six import unichr as _unichr
2020

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

thirdparty/ansistrm/ansistrm.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#
55

66
import logging
7-
import os
8-
import re
97
import sys
108

119
from lib.core.settings import IS_WIN

thirdparty/beautifulsoup/beautifulsoup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
__license__ = "New-style BSD"
8686

8787
import codecs
88-
import types
8988
import re
9089
import sys
9190

@@ -2029,6 +2028,5 @@ def _ebcdic_to_ascii(self, s):
20292028

20302029
#By default, act as an HTML pretty-printer.
20312030
if __name__ == '__main__':
2032-
import sys
20332031
soup = BeautifulSoup(sys.stdin)
20342032
print(soup.prettify())

thirdparty/fcrypt/fcrypt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
# ----- END fcrypt.c LICENSE -----
120120

121121

122-
import string, struct, sys
122+
import struct, sys
123123

124124
if sys.version_info >= (3, 0):
125125
xrange = range

thirdparty/keepalive/keepalive.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def error_handler(url):
517517
keepalive_handler.close_all()
518518

519519
def continuity(url):
520-
import md5
520+
from hashlib import md5
521521
format = '%25s: %s'
522522

523523
# first fetch the file with the normal http handler
@@ -526,7 +526,7 @@ def continuity(url):
526526
fo = _urllib.request.urlopen(url)
527527
foo = fo.read()
528528
fo.close()
529-
m = md5.new(foo)
529+
m = md5(foo)
530530
print(format % ('normal urllib', m.hexdigest()))
531531

532532
# now install the keepalive handler and try again
@@ -536,7 +536,7 @@ def continuity(url):
536536
fo = _urllib.request.urlopen(url)
537537
foo = fo.read()
538538
fo.close()
539-
m = md5.new(foo)
539+
m = md5(foo)
540540
print(format % ('keepalive read', m.hexdigest()))
541541

542542
fo = _urllib.request.urlopen(url)
@@ -546,7 +546,7 @@ def continuity(url):
546546
if f: foo = foo + f
547547
else: break
548548
fo.close()
549-
m = md5.new(foo)
549+
m = md5(foo)
550550
print(format % ('keepalive readline', m.hexdigest()))
551551

552552
def comp(N, url):

thirdparty/magic/magic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ def from_buffer(buffer, mime=False):
117117
pass
118118

119119
if not libmagic or not libmagic._name:
120-
import sys
121120
platform_to_lib = {'darwin': ['/opt/local/lib/libmagic.dylib',
122121
'/usr/local/lib/libmagic.dylib',
123122
'/usr/local/Cellar/libmagic/5.10/lib/libmagic.dylib'],
@@ -223,4 +222,4 @@ def magic_load(cookie, filename):
223222
MAGIC_NO_CHECK_TROFF = 0x040000 # Don't check ascii/troff
224223
MAGIC_NO_CHECK_FORTRAN = 0x080000 # Don't check ascii/fortran
225224
MAGIC_NO_CHECK_TOKENS = 0x100000 # Don't check ascii/tokens
226-
MAGIC_UNKNOWN_FILETYPE = b"unknown"
225+
MAGIC_UNKNOWN_FILETYPE = b"unknown"

thirdparty/multipart/multipartpost.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
from lib.core.compat import choose_boundary
3131
from lib.core.convert import getBytes
32-
from lib.core.convert import getText
3332
from lib.core.exception import SqlmapDataException
3433
from thirdparty.six.moves import urllib as _urllib
3534

thirdparty/six/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import types
3030

3131
__author__ = "Benjamin Peterson <[email protected]>"
32-
__version__ = "1.15.0"
32+
__version__ = "1.16.0"
3333

3434

3535
# Useful for very coarse version differentiation.
@@ -71,6 +71,11 @@ def __len__(self):
7171
MAXSIZE = int((1 << 63) - 1)
7272
del X
7373

74+
if PY34:
75+
from importlib.util import spec_from_loader
76+
else:
77+
spec_from_loader = None
78+
7479

7580
def _add_doc(func, doc):
7681
"""Add documentation to a function."""
@@ -186,6 +191,11 @@ def find_module(self, fullname, path=None):
186191
return self
187192
return None
188193

194+
def find_spec(self, fullname, path, target=None):
195+
if fullname in self.known_modules:
196+
return spec_from_loader(fullname, self)
197+
return None
198+
189199
def __get_module(self, fullname):
190200
try:
191201
return self.known_modules[fullname]

0 commit comments

Comments
 (0)