[gtk-osx: 47/48] Avoid crash if _python_ver comes up empty.



commit 69903ff857de6276a35cc3889b0028de6d876271
Author: John Ralls <jralls ceridwen us>
Date:   Tue May 14 16:46:43 2019 -0700

    Avoid crash if _python_ver comes up empty.

 jhbuildrc-gtk-osx | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/jhbuildrc-gtk-osx b/jhbuildrc-gtk-osx
index 13f8a01..240efa5 100644
--- a/jhbuildrc-gtk-osx
+++ b/jhbuildrc-gtk-osx
@@ -578,11 +578,12 @@ if not _ran_recursively and _gtk_osx_prompt_prefix:
 if (not "python" in modules and not 'python3' in modules and
     not os.path.exists(os.path.join(prefix, 'bin', 'python2'))):
     _python_ver = _popen('bash -c "python -V"')
-    _python_ver = 'python' + _python_ver.split(" ")[1][0:3]
-    _python_install_path = os.path.join(prefix, 'lib',
-                                       _python_ver, 'site-packages')
-    append_autogenargs('libxml2',
-                       '--with-python-install-dir=' + _python_install_path)
+    if _python_ver:
+        _python_ver = 'python' + _python_ver.split(" ")[1][0:3]
+        _python_install_path = os.path.join(prefix, 'lib',
+                                            _python_ver, 'site-packages')
+        append_autogenargs('libxml2',
+                           '--with-python-install-dir=' + _python_install_path)
 
 # Unset this so we don't mess with the check for not starting
 # recursively.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]