From b568546fb8554120673963e98098757534c7f826 Mon Sep 17 00:00:00 2001 From: Andy Kittner Date: Sat, 29 Jun 2013 15:21:58 +0200 Subject: [PATCH] Add some explanation to is_portable(); fixes #729 --- openslides/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openslides/main.py b/openslides/main.py index e4cd32b61..0d609b641 100644 --- a/openslides/main.py +++ b/openslides/main.py @@ -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"