Brrrrr incompatibilities with every new Python minor revision

This commit is contained in:
Miroslav Stampar 2021-01-15 09:31:57 +01:00
parent 4490d55482
commit d78590213b
5 changed files with 10 additions and 10 deletions

View File

@ -9,7 +9,6 @@ from __future__ import division
import binascii import binascii
import codecs import codecs
import collections
import contextlib import contextlib
import copy import copy
import distutils.version import distutils.version
@ -194,6 +193,7 @@ from thirdparty.colorama.initialise import init as coloramainit
from thirdparty.magic import magic from thirdparty.magic import magic
from thirdparty.odict import OrderedDict from thirdparty.odict import OrderedDict
from thirdparty.six import unichr as _unichr 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 configparser as _configparser
from thirdparty.six.moves import http_client as _http_client from thirdparty.six.moves import http_client as _http_client
from thirdparty.six.moves import input as _input from thirdparty.six.moves import input as _input
@ -3267,7 +3267,7 @@ def filterNone(values):
retVal = values retVal = values
if isinstance(values, collections.Iterable): if isinstance(values, _collections.Iterable):
retVal = [_ for _ in values if _] retVal = [_ for _ in values if _]
return retVal return retVal
@ -3558,7 +3558,7 @@ def arrayizeValue(value):
['1'] ['1']
""" """
if isinstance(value, collections.KeysView): if isinstance(value, _collections.KeysView):
value = [_ for _ in value] value = [_ for _ in value]
elif not isListLike(value): elif not isListLike(value):
value = [value] value = [value]

View File

@ -13,7 +13,6 @@ except:
import base64 import base64
import binascii import binascii
import codecs import codecs
import collections
import json import json
import re import re
import sys import sys
@ -31,6 +30,7 @@ from lib.core.settings import SAFE_HEX_MARKER
from lib.core.settings import UNICODE_ENCODING from lib.core.settings import UNICODE_ENCODING
from thirdparty import six from thirdparty import six
from thirdparty.six import unichr as _unichr from thirdparty.six import unichr as _unichr
from thirdparty.six.moves import collections_abc as _collections
try: try:
from html import escape as htmlEscape from html import escape as htmlEscape
@ -106,7 +106,7 @@ def singleTimeWarnMessage(message): # Cross-referenced function
sys.stdout.flush() sys.stdout.flush()
def filterNone(values): # Cross-referenced function 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 def isListLike(value): # Cross-referenced function
return isinstance(value, (list, tuple, set, BigArray)) return isinstance(value, (list, tuple, set, BigArray))

View File

@ -9,7 +9,7 @@ import copy
import types import types
from thirdparty.odict import OrderedDict from thirdparty.odict import OrderedDict
from thirdparty.six.moves import collections_abc from thirdparty.six.moves import collections_abc as _collections
class AttribDict(dict): class AttribDict(dict):
""" """
@ -159,7 +159,7 @@ class LRUDict(object):
return self.cache.keys() return self.cache.keys()
# Reference: https://code.activestate.com/recipes/576694/ # 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 This class defines the set with ordered (as added) items

View File

@ -8,7 +8,6 @@ See the file 'LICENSE' for copying permission
from __future__ import division from __future__ import division
import codecs import codecs
import collections
import functools import functools
import glob import glob
import inspect import inspect
@ -154,6 +153,7 @@ from lib.utils.search import search
from thirdparty import six from thirdparty import six
from thirdparty.keepalive import keepalive from thirdparty.keepalive import keepalive
from thirdparty.multipart import multipartpost 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_client as _http_client
from thirdparty.six.moves import http_cookiejar as _http_cookiejar from thirdparty.six.moves import http_cookiejar as _http_cookiejar
from thirdparty.six.moves import urllib as _urllib from thirdparty.six.moves import urllib as _urllib
@ -415,7 +415,7 @@ def _doSearch():
conf.googlePage += 1 conf.googlePage += 1
def _setStdinPipeTargets(): def _setStdinPipeTargets():
if isinstance(conf.stdinPipe, collections.Iterable): if isinstance(conf.stdinPipe, _collections.Iterable):
infoMsg = "using 'STDIN' for parsing targets list" infoMsg = "using 'STDIN' for parsing targets list"
logger.info(infoMsg) logger.info(infoMsg)

View File

@ -18,7 +18,7 @@ from lib.core.enums import OS
from thirdparty.six import unichr as _unichr from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.5.1.31" VERSION = "1.5.1.32"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} 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) VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)