Skip to content

Commit cc792de

Browse files
authored
7608 py2 fix (#5)
We only build PySide2 binaries for Python 3, the aim being Unreal. However, the framework ships some hooks which are used in other DCCs, where PySide is available natively, and run Python 2 (e.g. Maya 2020). Allowed the framework to be loaded, even if a PySide2 build is not available for the current Python, if PySide or PySide2 is already available.
1 parent 9a4312d commit cc792de

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

framework.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ def init_framework(self):
3333
"""
3434
self.log_debug("%s: Initializing UnrealQtFramework..." % self)
3535

36+
# Check if PySide is already available, do nothing if it is the case
37+
try:
38+
from sgtk.platform.qt import QtCore
39+
self.log_debug("Qt is already available, not activating any custom package.")
40+
return
41+
except ImportError as e:
42+
self.log_debug("Qt is not available: %s, activating custom package." % e)
43+
pass
3644
# Remap the platform name to our names
3745
pname = self.platform_name()
3846

0 commit comments

Comments
 (0)