Fixing DeprecationWarning (logger.warn)

This commit is contained in:
Miroslav Stampar
2022-06-22 12:04:34 +02:00
parent 90b444c927
commit df4293473d
99 changed files with 429 additions and 428 deletions

View File

@@ -46,7 +46,7 @@ class Connector(GenericConnector):
try:
return self.cursor.fetchall()
except psycopg2.ProgrammingError as ex:
logger.warn(getSafeExString(ex))
logger.warning(getSafeExString(ex))
return None
def execute(self, query):
@@ -56,7 +56,7 @@ class Connector(GenericConnector):
self.cursor.execute(query)
retVal = True
except (psycopg2.OperationalError, psycopg2.ProgrammingError) as ex:
logger.warn(("(remote) '%s'" % getSafeExString(ex)).strip())
logger.warning(("(remote) '%s'" % getSafeExString(ex)).strip())
except psycopg2.InternalError as ex:
raise SqlmapConnectionException(getSafeExString(ex))

View File

@@ -12,4 +12,4 @@ from plugins.generic.enumeration import Enumeration as GenericEnumeration
class Enumeration(GenericEnumeration):
def getHostname(self):
warnMsg = "on PostgreSQL it is not possible to enumerate the hostname"
logger.warn(warnMsg)
logger.warning(warnMsg)

View File

@@ -117,7 +117,7 @@ class Fingerprint(GenericFingerprint):
if not result:
warnMsg = "the back-end DBMS is not %s" % DBMS.PGSQL
logger.warn(warnMsg)
logger.warning(warnMsg)
return False
@@ -187,7 +187,7 @@ class Fingerprint(GenericFingerprint):
return True
else:
warnMsg = "the back-end DBMS is not %s" % DBMS.PGSQL
logger.warn(warnMsg)
logger.warning(warnMsg)
return False