From d78590213bc1af0a39ada2033da2179f2481afa0 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 15 Jan 2021 09:31:57 +0100 Subject: [PATCH] Brrrrr incompatibilities with every new Python minor revision --- lib/core/common.py | 6 +++--- lib/core/convert.py | 4 ++-- lib/core/datatype.py | 4 ++-- lib/core/option.py | 4 ++-- lib/core/settings.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 47647b83d..0478c2c1e 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -9,7 +9,6 @@ from __future__ import division import binascii import codecs -import collections import contextlib import copy import distutils.version @@ -194,6 +193,7 @@ from thirdparty.colorama.initialise import init as coloramainit from thirdparty.magic import magic from thirdparty.odict import OrderedDict from thirdparty.six import unichr as _unichr +from thirdparty.six.moves import collections_abc as _collections from thirdparty.six.moves import configparser as _configparser from thirdparty.six.moves import http_client as _http_client from thirdparty.six.moves import input as _input @@ -3267,7 +3267,7 @@ def filterNone(values): retVal = values - if isinstance(values, collections.Iterable): + if isinstance(values, _collections.Iterable): retVal = [_ for _ in values if _] return retVal @@ -3558,7 +3558,7 @@ def arrayizeValue(value): ['1'] """ - if isinstance(value, collections.KeysView): + if isinstance(value, _collections.KeysView): value = [_ for _ in value] elif not isListLike(value): value = [value] diff --git a/lib/core/convert.py b/lib/core/convert.py index d48bdfee8..520c306a4 100644 --- a/lib/core/convert.py +++ b/lib/core/convert.py @@ -13,7 +13,6 @@ except: import base64 import binascii import codecs -import collections import json import re import sys @@ -31,6 +30,7 @@ from lib.core.settings import SAFE_HEX_MARKER from lib.core.settings import UNICODE_ENCODING from thirdparty import six from thirdparty.six import unichr as _unichr +from thirdparty.six.moves import collections_abc as _collections try: from html import escape as htmlEscape @@ -106,7 +106,7 @@ def singleTimeWarnMessage(message): # Cross-referenced function sys.stdout.flush() def filterNone(values): # Cross-referenced function - return [_ for _ in values if _] if isinstance(values, collections.Iterable) else values + return [_ for _ in values if _] if isinstance(values, _collections.Iterable) else values def isListLike(value): # Cross-referenced function return isinstance(value, (list, tuple, set, BigArray)) diff --git a/lib/core/datatype.py b/lib/core/datatype.py index 739780d5b..412d54543 100644 --- a/lib/core/datatype.py +++ b/lib/core/datatype.py @@ -9,7 +9,7 @@ import copy import types from thirdparty.odict import OrderedDict -from thirdparty.six.moves import collections_abc +from thirdparty.six.moves import collections_abc as _collections class AttribDict(dict): """ @@ -159,7 +159,7 @@ class LRUDict(object): return self.cache.keys() # Reference: https://code.activestate.com/recipes/576694/ -class OrderedSet(collections_abc.MutableSet): +class OrderedSet(_collections.MutableSet): """ This class defines the set with ordered (as added) items diff --git a/lib/core/option.py b/lib/core/option.py index e4cba0cc9..d30779963 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -8,7 +8,6 @@ See the file 'LICENSE' for copying permission from __future__ import division import codecs -import collections import functools import glob import inspect @@ -154,6 +153,7 @@ from lib.utils.search import search from thirdparty import six from thirdparty.keepalive import keepalive from thirdparty.multipart import multipartpost +from thirdparty.six.moves import collections_abc as _collections from thirdparty.six.moves import http_client as _http_client from thirdparty.six.moves import http_cookiejar as _http_cookiejar from thirdparty.six.moves import urllib as _urllib @@ -415,7 +415,7 @@ def _doSearch(): conf.googlePage += 1 def _setStdinPipeTargets(): - if isinstance(conf.stdinPipe, collections.Iterable): + if isinstance(conf.stdinPipe, _collections.Iterable): infoMsg = "using 'STDIN' for parsing targets list" logger.info(infoMsg) diff --git a/lib/core/settings.py b/lib/core/settings.py index 5f3c766cd..0f89cf9fc 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.5.1.31" +VERSION = "1.5.1.32" 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)