mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 01:26:42 +03:00
Fix for missing global name __file__
This commit is contained in:
parent
6b280d8da4
commit
840af1fa7b
|
@ -6,6 +6,7 @@ See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import bdb
|
import bdb
|
||||||
|
import inspect
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
@ -50,7 +51,12 @@ def modulePath():
|
||||||
using py2exe
|
using py2exe
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return os.path.dirname(os.path.realpath(getUnicode(sys.executable if weAreFrozen() else __file__, sys.getfilesystemencoding())))
|
try:
|
||||||
|
_ = sys.executable if weAreFrozen() else __file__
|
||||||
|
except NameError:
|
||||||
|
_ = inspect.getsourcefile(modulePath)
|
||||||
|
|
||||||
|
return os.path.dirname(os.path.realpath(getUnicode(_, sys.getfilesystemencoding())))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user