From 62e8aacd9f6ae5e4838c4d383a3d1a592d0c156a Mon Sep 17 00:00:00 2001 From: MattHag <16444067+MattHag@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:34:06 +0100 Subject: [PATCH] Remove Python 2 specific path handling Related #2273 --- bin/solaar | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/bin/solaar b/bin/solaar index 17cecc26..07ceeee9 100755 --- a/bin/solaar +++ b/bin/solaar @@ -24,20 +24,7 @@ def init_paths(): import os.path import sys - # Python 3 might have problems converting back to UTF-8 in case of Unicode surrogates - 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), "..") + root = os.path.join(os.path.realpath(sys.path[0]), "..") prefix = os.path.normpath(root) src_lib = os.path.join(prefix, "lib") share_lib = os.path.join(prefix, "share", "solaar", "lib")