From b7415d36dfe956fa0fcccbab382e1ed95ad615ef Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 21 Aug 2012 10:28:25 +0200 Subject: [PATCH] Minor refactoring --- _sqlmap.py | 4 ++-- lib/core/threads.py | 2 +- lib/utils/hashdb.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_sqlmap.py b/_sqlmap.py index 7d6e97cc9..56b30e3a7 100755 --- a/_sqlmap.py +++ b/_sqlmap.py @@ -107,12 +107,12 @@ def main(): kb.threadContinue = False kb.threadException = True - if conf.get("hashDB", None): + if conf.get("hashDB"): try: conf.hashDB.flush(True) except KeyboardInterrupt: pass # Reference: http://stackoverflow.com/questions/1635080/terminate-a-multi-thread-python-program - if conf.get("threads", 0) > 1 or conf.get("dnsServer", None): + if conf.get("threads", 0) > 1 or conf.get("dnsServer"): os._exit(0) diff --git a/lib/core/threads.py b/lib/core/threads.py index 9471c83e3..e5b449d00 100644 --- a/lib/core/threads.py +++ b/lib/core/threads.py @@ -195,7 +195,7 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio if lock.locked_lock(): lock.release() - if conf.get("hashDB", None): + if conf.get("hashDB"): conf.hashDB.flush(True) if cleanupFunction: diff --git a/lib/utils/hashdb.py b/lib/utils/hashdb.py index a2ae4cda4..90ea5b633 100644 --- a/lib/utils/hashdb.py +++ b/lib/utils/hashdb.py @@ -57,7 +57,7 @@ class HashDB(object): retVal = None if key and (self._write_cache or os.path.isfile(self.filepath)): hash_ = HashDB.hashKey(key) - retVal = self._write_cache.get(hash_, None) + retVal = self._write_cache.get(hash_) if not retVal: while True: try: