MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / checkEnvironment

Function checkEnvironment

sqlmap.py:116–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114 return getUnicode(os.path.dirname(os.path.realpath(_)), encoding=sys.getfilesystemencoding() or UNICODE_ENCODING)
115
116def checkEnvironment():
117 try:
118 os.path.isdir(modulePath())
119 except UnicodeEncodeError:
120 errMsg = "your system does not properly handle non-ASCII paths. "
121 errMsg += "Please move the sqlmap's directory to the other location"
122 logger.critical(errMsg)
123 raise SystemExit
124
125 if LooseVersion(VERSION) < LooseVersion("1.0"):
126 errMsg = "your runtime environment (e.g. PYTHONPATH) is "
127 errMsg += "broken. Please make sure that you are not running "
128 errMsg += "newer versions of sqlmap with runtime scripts for older "
129 errMsg += "versions"
130 logger.critical(errMsg)
131 raise SystemExit
132
133 # Patch for pip (import) environment
134 if "sqlmap.sqlmap" in sys.modules:
135 for _ in ("cmdLineOptions", "conf", "kb"):
136 globals()[_] = getattr(sys.modules["lib.core.data"], _)
137
138 for _ in ("SqlmapBaseException", "SqlmapShellQuitException", "SqlmapSilentQuitException", "SqlmapUserQuitException"):
139 globals()[_] = getattr(sys.modules["lib.core.exception"], _)
140
141def main():
142 """

Callers 1

mainFunction · 0.85

Calls 2

LooseVersionFunction · 0.90
modulePathFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…