File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
lib/inputstreamhelper/widevine Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -127,16 +127,18 @@ def ia_cdm_path():
127
127
128
128
def get_lib_version (path ):
129
129
"""
130
- Determines version of the Widevine library.
130
+ Determines version of the Widevine library using the python ctypes module .
131
131
Returns empty string if not possible, which might indicate a problematic file/arch mismatch, so this can be used as a check.
132
132
"""
133
133
from ctypes import CDLL , c_char_p
134
+ from _ctypes import dlclose
134
135
135
136
lib_version = ''
136
137
try :
137
138
lib = CDLL (compat_path (path ))
138
139
lib .GetCdmVersion .restype = c_char_p
139
140
lib_version = to_unicode (lib .GetCdmVersion ())
141
+ dlclose (lib ._handle ) # pylint: disable=protected-access
140
142
except (OSError , AttributeError ) as exc :
141
143
log (4 , 'Failed to determine lib version: ' + str (exc ))
142
144
Original file line number Diff line number Diff line change @@ -87,11 +87,11 @@ def rmdir(path):
87
87
def translatePath (path ):
88
88
"""A stub implementation of the xbmc translatePath() function"""
89
89
if path .startswith ('special://home' ):
90
- return path .replace ('special://home' , os .path .join (os .getcwd (), 'tests/ ' ))
90
+ return path .replace ('special://home' , os .path .join (os .getcwd (), 'tests' ))
91
91
if path .startswith ('special://masterprofile' ):
92
- return path .replace ('special://masterprofile' , os .path .join (os .getcwd (), 'tests/userdata/ ' ))
92
+ return path .replace ('special://masterprofile' , os .path .join (os .getcwd (), 'tests/userdata' ))
93
93
if path .startswith ('special://profile' ):
94
- return path .replace ('special://profile' , os .path .join (os .getcwd (), 'tests/userdata/ ' ))
94
+ return path .replace ('special://profile' , os .path .join (os .getcwd (), 'tests/userdata' ))
95
95
if path .startswith ('special://userdata' ):
96
- return path .replace ('special://userdata' , os .path .join (os .getcwd (), 'tests/userdata/ ' ))
96
+ return path .replace ('special://userdata' , os .path .join (os .getcwd (), 'tests/userdata' ))
97
97
return path
You can’t perform that action at this time.
0 commit comments