mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 13:11:29 +00:00
Fixes #2146
This commit is contained in:
@@ -85,6 +85,9 @@ def modulePath():
|
||||
return getUnicode(os.path.dirname(os.path.realpath(_)), encoding=sys.getfilesystemencoding() or UNICODE_ENCODING)
|
||||
|
||||
def checkEnvironment():
|
||||
global conf
|
||||
global kb
|
||||
|
||||
try:
|
||||
os.path.isdir(modulePath())
|
||||
except UnicodeEncodeError:
|
||||
@@ -101,6 +104,11 @@ def checkEnvironment():
|
||||
logger.critical(errMsg)
|
||||
raise SystemExit
|
||||
|
||||
# Patch for pip environment
|
||||
if "sqlmap.sqlmap" in sys.modules:
|
||||
kb = sys.modules["lib.core.data"].kb
|
||||
conf = sys.modules["lib.core.data"].conf
|
||||
|
||||
def main():
|
||||
"""
|
||||
Main function of sqlmap when running from command line.
|
||||
|
||||
Reference in New Issue
Block a user