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():
127127
128128def get_lib_version (path ):
129129 """
130- Determines version of the Widevine library.
130+ Determines version of the Widevine library using the python ctypes module .
131131 Returns empty string if not possible, which might indicate a problematic file/arch mismatch, so this can be used as a check.
132132 """
133133 from ctypes import CDLL , c_char_p
134+ from _ctypes import dlclose
134135
135136 lib_version = ''
136137 try :
137138 lib = CDLL (compat_path (path ))
138139 lib .GetCdmVersion .restype = c_char_p
139140 lib_version = to_unicode (lib .GetCdmVersion ())
141+ dlclose (lib ._handle ) # pylint: disable=protected-access
140142 except (OSError , AttributeError ) as exc :
141143 log (4 , 'Failed to determine lib version: ' + str (exc ))
142144
Original file line number Diff line number Diff line change @@ -87,11 +87,11 @@ def rmdir(path):
8787def translatePath (path ):
8888 """A stub implementation of the xbmc translatePath() function"""
8989 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' ))
9191 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' ))
9393 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' ))
9595 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' ))
9797 return path
You can’t perform that action at this time.
0 commit comments