From 9030b219634ce95ac35feb85839fc3f6a81b601d Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Tue, 24 Jun 2025 10:59:22 -0700 Subject: [PATCH 1/2] Revert #71 --- python/shotgun_desktop/startup.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/python/shotgun_desktop/startup.py b/python/shotgun_desktop/startup.py index 03bdd282..c8d32d4e 100644 --- a/python/shotgun_desktop/startup.py +++ b/python/shotgun_desktop/startup.py @@ -17,32 +17,6 @@ # initialize logging import logging -# The value of sys.executable under multiple platforms and multiple versions -# of Desktop is unreliable. Therefore, we're patch the value if the executable -# name is not Shotgun or ShotGrid. -# -# So, we'll use sys.prefix which is properly set and backtrack to the executable. -# When the executable is fixed we should come back here and put a check for the version -# number so we stop updating sys.executable - -# Grab the name and the executable -executable_name, ext = os.path.splitext(os.path.basename(sys.executable or "")) - -# If the executable is not named Shotgun or ShotGrid, then we need to patch sys.executable. -if executable_name.lower() not in ["shotgun", "shotgrid"]: - # On macOS, sys.prefix is set to /Applications/Shotgun.app/Contents/Resources/python, - # so we need to drill down differently for the executable folder than on other platforms - if sys.platform == "darwin": - bin_dir = os.path.join(sys.prefix, "..", "..", "MacOS") - else: - # On Linux and Windows, the sys.prefix points to Shotgun/Python, so we only - # need to move up one folder. - bin_dir = os.path.join(sys.prefix, "..") - - # Set the executable name and make sure to put back in the extension for Windows. - sys.executable = os.path.normpath(os.path.join(bin_dir, "Shotgun%s" % ext)) - - def _enumerate_per_line(items): """ Enumerate all items from an array, one line at a time. From e5888d12445c6d269540cb224026f7211b86e074 Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Wed, 25 Jun 2025 08:31:40 -0700 Subject: [PATCH 2/2] fixup! Revert #71 --- python/shotgun_desktop/startup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/shotgun_desktop/startup.py b/python/shotgun_desktop/startup.py index c8d32d4e..8e095b59 100644 --- a/python/shotgun_desktop/startup.py +++ b/python/shotgun_desktop/startup.py @@ -17,6 +17,7 @@ # initialize logging import logging + def _enumerate_per_line(items): """ Enumerate all items from an array, one line at a time.