Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e9d7a77

Browse files
committed
Fixing a DeprecationWarning with activeCount()
1 parent 182c06e commit e9d7a77

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

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.5.10.9"
23+
VERSION = "1.5.10.10"
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)

lib/core/threads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
198198
if numThreads > 1:
199199
logger.info("waiting for threads to finish%s" % (" (Ctrl+C was pressed)" if isinstance(ex, KeyboardInterrupt) else ""))
200200
try:
201-
while (threading.activeCount() > 1):
201+
while (threading.active_count() > 1):
202202
pass
203203

204204
except KeyboardInterrupt:

sqlmap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def main():
533533

534534
# short delay for thread finalization
535535
_ = time.time()
536-
while threading.activeCount() > 1 and (time.time() - _) > THREAD_FINALIZATION_TIMEOUT:
536+
while threading.active_count() > 1 and (time.time() - _) > THREAD_FINALIZATION_TIMEOUT:
537537
time.sleep(0.01)
538538

539539
if cmdLineOptions.get("sqlmapShell"):
@@ -554,7 +554,7 @@ def main():
554554
traceback.print_exc()
555555
finally:
556556
# Reference: http://stackoverflow.com/questions/1635080/terminate-a-multi-thread-python-program
557-
if threading.activeCount() > 1:
557+
if threading.active_count() > 1:
558558
os._exit(getattr(os, "_exitcode", 0))
559559
else:
560560
sys.exit(getattr(os, "_exitcode", 0))

0 commit comments

Comments
 (0)