3
3
# file included in this repository.
4
4
5
5
"""
6
- Framework containing PySide2 distributions for the Unreal engine
6
+ Framework containing PySide distributions for the Unreal engine
7
7
8
- Because Unreal does not include PySide2 /Qt distributions but does use its own
8
+ Because Unreal does not include PySide /Qt distributions but does use its own
9
9
version of Python, we have to distribute full versions for the engine to function.
10
10
"""
11
11
@@ -31,15 +31,15 @@ def init_framework(self):
31
31
Something similar to what `virtualenv` does is done when this framework is
32
32
loaded by SG TK.
33
33
"""
34
- self .log_debug ("%s: Initializing UnrealQtFramework..." % self )
34
+ self .logger . debug ("%s: Initializing UnrealQtFramework..." % self )
35
35
36
36
# Check if PySide is already available, do nothing if it is the case
37
37
try :
38
38
from sgtk .platform .qt import QtCore # noqa
39
- self .log_debug ("Qt is already available, not activating any custom package." )
39
+ self .logger . debug ("Qt is already available, not activating any custom package." )
40
40
return
41
41
except ImportError as e :
42
- self .log_debug ("Qt is not available: %s, activating custom package." % e )
42
+ self .logger . debug ("Qt is not available: %s, activating custom package." % e )
43
43
pass
44
44
# Remap the platform name to our names
45
45
pname = self .platform_name ()
@@ -53,13 +53,14 @@ def init_framework(self):
53
53
# Copied over from activate_this.py script which does not exist anymore
54
54
# from Python 3.
55
55
python_major = sys .version_info [0 ] # 2 or 3
56
+ python_minor = sys .version_info [1 ] # 6, 7, 8, etc
56
57
57
58
base_path = os .path .realpath (
58
59
os .path .join (
59
60
os .path .dirname (__file__ ),
60
61
"python" ,
61
62
"vendors" ,
62
- "py%d" % python_major ,
63
+ "py%d.%d " % ( python_major , python_minor ) ,
63
64
pname ,
64
65
)
65
66
)
@@ -74,7 +75,7 @@ def init_framework(self):
74
75
"lib"
75
76
)
76
77
)
77
- python_pattern = r"^python%d\.\d$" % python_major
78
+ python_pattern = r"^python%d\.\d+ $" % python_major
78
79
for folder in lib_folders :
79
80
if re .match (python_pattern , folder ):
80
81
break
@@ -108,7 +109,7 @@ def init_framework(self):
108
109
sys .prefix = base_path
109
110
110
111
def destroy_framework (self ):
111
- self .log_debug ("%s: Destroying UnrealQtFramework..." % self )
112
+ self .logger . debug ("%s: Destroying UnrealQtFramework..." % self )
112
113
113
114
@classmethod
114
115
def platform_name (cls ):
0 commit comments