Skip to content

Commit 3117730

Browse files
committed
Fixes #5364
1 parent 323af98 commit 3117730

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

lib/core/compat.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import binascii
1111
import functools
12+
import inspect
1213
import math
1314
import os
1415
import random
@@ -312,3 +313,20 @@ def LooseVersion(version):
312313
result = float("NaN")
313314

314315
return result
316+
317+
# Reference: https://github.com/bottlepy/bottle/blob/df67999584a0e51ec5b691146c7fa4f3c87f5aac/bottle.py
318+
if not hasattr(inspect, "getargspec") and hasattr(inspect, "getfullargspec"):
319+
from inspect import getfullargspec
320+
321+
def makelist(data):
322+
if isinstance(data, (tuple, list, set, dict)):
323+
return list(data)
324+
elif data:
325+
return [data]
326+
else:
327+
return []
328+
329+
def getargspec(func):
330+
spec = getfullargspec(func)
331+
kwargs = makelist(spec[0]) + makelist(spec.kwonlyargs)
332+
return kwargs, spec[1], spec[2], spec[3]

lib/core/option.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ def _setTamperingFunctions():
815815
priority = PRIORITY.NORMAL if not hasattr(module, "__priority__") else module.__priority__
816816

817817
for name, function in inspect.getmembers(module, inspect.isfunction):
818-
if name == "tamper" and (hasattr(inspect, "signature") and all(_ in inspect.signature(function).parameters for _ in ("payload", "kwargs")) or hasattr(inspect, "getargspec") and inspect.getargspec(function).args and inspect.getargspec(function).keywords == "kwargs"):
818+
if name == "tamper" and (hasattr(inspect, "signature") and all(_ in inspect.signature(function).parameters for _ in ("payload", "kwargs")) or inspect.getargspec(function).args and inspect.getargspec(function).keywords == "kwargs"):
819819
found = True
820820
kb.tamperFunctions.append(function)
821821
function.__name__ = module.__name__

lib/core/settings.py

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

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

0 commit comments

Comments
 (0)