Patch for Python 2.6

This commit is contained in:
Miroslav Stampar 2019-03-28 22:54:05 +01:00
parent f8eed1f365
commit 09be7cb361
14 changed files with 14 additions and 14 deletions

View File

@ -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):

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -17,7 +17,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
from lib.core.enums import OS
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
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)

View File

@ -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:

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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

View File

@ -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 :-(

View File

@ -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

View File

@ -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:

View File

@ -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