Skip to content

Commit

Permalink
Remove Python 2 specific path handling
Browse files Browse the repository at this point in the history
  • Loading branch information
MattHag committed Nov 6, 2024
1 parent 862cef1 commit 7edc2ad
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions bin/solaar
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 7edc2ad

Please sign in to comment.