[vlc-commits] Fix for venv.

mrJean1 git at videolan.org
Mon May 4 23:53:44 CEST 2020


vlc/python | branch: master | mrJean1 <22154337+mrJean1 at users.noreply.github.com> | Mon May  4 14:37:27 2020 -0400| [14033c67abc5b58d820aa29d6f92ec768ad07257] | committer: GitHub

Fix for venv.

Use sys.base_prefix if available inlieu of sys.prefix to find the libtk.dylib on macOS in venv's.

> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=14033c67abc5b58d820aa29d6f92ec768ad07257
---

 examples/tkvlc.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/examples/tkvlc.py b/examples/tkvlc.py
index 59cf15b..21a877b 100755
--- a/examples/tkvlc.py
+++ b/examples/tkvlc.py
@@ -27,7 +27,7 @@ Date: 23-09-2015
 """
 
 # Tested with Python 3.7.4, tkinter/Tk 8.6.9 on macOS 10.13.6 only.
-__version__ = '19.07.29'  # mrJean1 at Gmail dot com
+__version__ = '20.05.04'  # mrJean1 at Gmail
 
 # import external libraries
 import vlc
@@ -49,7 +49,7 @@ import time
 
 _isMacOS   = sys.platform.startswith('darwin')
 _isWindows = sys.platform.startswith('win')
-_isLinux = sys.platform.startswith('linux')
+_isLinux   = sys.platform.startswith('linux')
 
 if _isMacOS:
     from ctypes import c_void_p, cdll
@@ -59,7 +59,8 @@ if _isMacOS:
     # to match the version number of tkinter, _tkinter, etc.
     try:
         libtk = 'libtk%s.dylib' % (Tk.TkVersion,)
-        libtk = joined(sys.prefix, 'lib', libtk)
+        prefix = getattr(sys, 'base_prefix', sys.prefix)
+        libtk = joined(prefix, 'lib', libtk)
         dylib = cdll.LoadLibrary(libtk)
         # getNSView = dylib.TkMacOSXDrawableView is the
         # proper function to call, but that is non-public



More information about the vlc-commits mailing list