Remove Python 2 specific path handling

Related #2273
This commit is contained in:
MattHag 2024-11-06 19:34:06 +01:00 committed by Peter F. Patel-Schneider
parent 8eb0aec3e8
commit 62e8aacd9f
1 changed files with 1 additions and 14 deletions

View File

@ -24,20 +24,7 @@ def init_paths():
import os.path import os.path
import sys import sys
# Python 3 might have problems converting back to UTF-8 in case of Unicode surrogates root = os.path.join(os.path.realpath(sys.path[0]), "..")
decoded_path = None
try:
decoded_path = sys.path[0]
sys.path[0].encode(sys.getfilesystemencoding())
except UnicodeError:
sys.stderr.write(
"ERROR: Solaar cannot recognize encoding of filesystem path, "
"this may happen due to non UTF-8 characters in the pathname.\n"
)
sys.exit(1)
root = os.path.join(os.path.realpath(decoded_path), "..")
prefix = os.path.normpath(root) prefix = os.path.normpath(root)
src_lib = os.path.join(prefix, "lib") src_lib = os.path.join(prefix, "lib")
share_lib = os.path.join(prefix, "share", "solaar", "lib") share_lib = os.path.join(prefix, "share", "solaar", "lib")