()
| 114 | return getUnicode(os.path.dirname(os.path.realpath(_)), encoding=sys.getfilesystemencoding() or UNICODE_ENCODING) |
| 115 | |
| 116 | def 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 | |
| 141 | def main(): |
| 142 | """ |
no test coverage detected
searching dependent graphs…