Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions python/shotgun_desktop/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +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):
"""
Expand Down