From 09be7cb361a09a823c16330a19c76e4ea0bc03bd Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 28 Mar 2019 22:54:05 +0100 Subject: [PATCH] Patch for Python 2.6 --- extra/cloak/cloak.py | 2 +- extra/dbgtool/dbgtool.py | 2 +- extra/safe2bin/safe2bin.py | 2 +- lib/core/compat.py | 2 +- lib/core/settings.py | 2 +- thirdparty/beautifulsoup/beautifulsoup.py | 2 +- thirdparty/chardet/eucjpprober.py | 2 +- thirdparty/chardet/mbcharsetprober.py | 2 +- thirdparty/chardet/sjisprober.py | 2 +- thirdparty/chardet/utf8prober.py | 2 +- thirdparty/clientform/clientform.py | 2 +- thirdparty/fcrypt/fcrypt.py | 2 +- thirdparty/gprof2dot/gprof2dot.py | 2 +- thirdparty/xdot/xdot.py | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/extra/cloak/cloak.py b/extra/cloak/cloak.py index 72f7fe1e2..345a061d1 100644 --- a/extra/cloak/cloak.py +++ b/extra/cloak/cloak.py @@ -17,7 +17,7 @@ import zlib from optparse import OptionError from optparse import OptionParser -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range def hideAscii(data): diff --git a/extra/dbgtool/dbgtool.py b/extra/dbgtool/dbgtool.py index 6cca8bdc2..2e7bd095d 100644 --- a/extra/dbgtool/dbgtool.py +++ b/extra/dbgtool/dbgtool.py @@ -34,7 +34,7 @@ def convert(inputFile): fileContent = fp.read() for fileChar in fileContent: - unsignedFileChar = fileChar if sys.version_info.major > 2 else ord(fileChar) + unsignedFileChar = fileChar if sys.version_info >= (3, 0) else ord(fileChar) if unsignedFileChar != 0: counter2 += 1 diff --git a/extra/safe2bin/safe2bin.py b/extra/safe2bin/safe2bin.py index b514c2a2a..6ccd9c1fb 100644 --- a/extra/safe2bin/safe2bin.py +++ b/extra/safe2bin/safe2bin.py @@ -18,7 +18,7 @@ import sys from optparse import OptionError from optparse import OptionParser -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range # Regex used for recognition of hex encoded characters diff --git a/lib/core/compat.py b/lib/core/compat.py index 74895c875..f08bfedc2 100644 --- a/lib/core/compat.py +++ b/lib/core/compat.py @@ -166,7 +166,7 @@ class WichmannHill(random.Random): def choose_boundary(): return uuid.uuid4().hex -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range else: xrange = xrange diff --git a/lib/core/settings.py b/lib/core/settings.py index a826a7050..e170238f4 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -17,7 +17,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.3.3.75" +VERSION = "1.3.3.76" 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) diff --git a/thirdparty/beautifulsoup/beautifulsoup.py b/thirdparty/beautifulsoup/beautifulsoup.py index 347118990..d29f688ef 100644 --- a/thirdparty/beautifulsoup/beautifulsoup.py +++ b/thirdparty/beautifulsoup/beautifulsoup.py @@ -89,7 +89,7 @@ import types import re import sys -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range try: diff --git a/thirdparty/chardet/eucjpprober.py b/thirdparty/chardet/eucjpprober.py index 2d4944c27..44995ed93 100644 --- a/thirdparty/chardet/eucjpprober.py +++ b/thirdparty/chardet/eucjpprober.py @@ -33,7 +33,7 @@ from .chardistribution import EUCJPDistributionAnalysis from .jpcntx import EUCJPContextAnalysis from .mbcssm import EUCJPSMModel -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range class EUCJPProber(MultiByteCharSetProber): diff --git a/thirdparty/chardet/mbcharsetprober.py b/thirdparty/chardet/mbcharsetprober.py index 45487f2d0..562a8cee6 100644 --- a/thirdparty/chardet/mbcharsetprober.py +++ b/thirdparty/chardet/mbcharsetprober.py @@ -31,7 +31,7 @@ import sys from . import constants from .charsetprober import CharSetProber -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range class MultiByteCharSetProber(CharSetProber): diff --git a/thirdparty/chardet/sjisprober.py b/thirdparty/chardet/sjisprober.py index 98d6ecac8..9a3186cb2 100644 --- a/thirdparty/chardet/sjisprober.py +++ b/thirdparty/chardet/sjisprober.py @@ -33,7 +33,7 @@ from .jpcntx import SJISContextAnalysis from .mbcssm import SJISSMModel from . import constants -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range class SJISProber(MultiByteCharSetProber): diff --git a/thirdparty/chardet/utf8prober.py b/thirdparty/chardet/utf8prober.py index edbac1200..95bab185c 100644 --- a/thirdparty/chardet/utf8prober.py +++ b/thirdparty/chardet/utf8prober.py @@ -31,7 +31,7 @@ from .charsetprober import CharSetProber from .codingstatemachine import CodingStateMachine from .mbcssm import UTF8SMModel -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range ONE_CHAR_PROB = 0.5 diff --git a/thirdparty/clientform/clientform.py b/thirdparty/clientform/clientform.py index 808973632..675916250 100644 --- a/thirdparty/clientform/clientform.py +++ b/thirdparty/clientform/clientform.py @@ -109,7 +109,7 @@ except ImportError: import sys, types, copy, re, random -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range # monkeypatch to fix http://www.python.org/sf/803422 :-( diff --git a/thirdparty/fcrypt/fcrypt.py b/thirdparty/fcrypt/fcrypt.py index c7ff3d063..ef601adb8 100644 --- a/thirdparty/fcrypt/fcrypt.py +++ b/thirdparty/fcrypt/fcrypt.py @@ -121,7 +121,7 @@ __all__ = ['crypt'] import string, struct, sys -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range _ITERATIONS = 16 diff --git a/thirdparty/gprof2dot/gprof2dot.py b/thirdparty/gprof2dot/gprof2dot.py index c907cbda4..64bf5e39b 100644 --- a/thirdparty/gprof2dot/gprof2dot.py +++ b/thirdparty/gprof2dot/gprof2dot.py @@ -32,7 +32,7 @@ import optparse import sys import xml.parsers.expat -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range try: diff --git a/thirdparty/xdot/xdot.py b/thirdparty/xdot/xdot.py index edbb486b7..a4aa0ff4d 100644 --- a/thirdparty/xdot/xdot.py +++ b/thirdparty/xdot/xdot.py @@ -39,7 +39,7 @@ import cairo import pango import pangocairo -if sys.version_info.major > 2: +if sys.version_info >= (3, 0): xrange = range # See http://www.graphviz.org/pub/scm/graphviz-cairo/plugin/cairo/gvrender_cairo.c