Add some explanation to is_portable(); fixes #729

This commit is contained in:
Andy Kittner 2013-06-29 15:21:58 +02:00
parent 2b4602068b
commit b568546fb8
1 changed files with 8 additions and 0 deletions

View File

@ -349,6 +349,14 @@ def get_user_data_path(*args):
def is_portable():
"""Return True if openslides is run as portable version"""
# NOTE: sys.executable is the path of the *interpreter*
# the portable version embeds python so it *is* the interpreter.
# The wrappers generated by pip and co. will spawn
# the usual python(w).exe, so there is no danger of mistaking
# them for the portable even though they may also be called
# openslides.exe
exename = os.path.basename(sys.executable).lower()
return exename == "openslides.exe"