diff --git a/fsl/fsleyes/gl/__init__.py b/fsl/fsleyes/gl/__init__.py index 90859e30d4e7f75c2843c701b171b337a3570507..52af7866c80c6afdd26dbd0acc829e1bec028b5d 100644 --- a/fsl/fsleyes/gl/__init__.py +++ b/fsl/fsleyes/gl/__init__.py @@ -285,11 +285,11 @@ def bootstrap(glVersion=None): thismod = sys.modules[__name__] if hasattr(thismod, '_bootstrapped'): - return + return if glVersion is None: glVer = gl.glGetString(gl.GL_VERSION).split()[0] - major, minor = map(int, glVer.split('.')) + major, minor = map(int, glVer.split('.'))[:2] else: major, minor = glVersion diff --git a/fsl/tools/fsleyes.py b/fsl/tools/fsleyes.py index fe0201e218de4329362e63059bd184dcaa9614e6..aedafad4b627b68ec61667bb2cc39ff0737659fe 100644 --- a/fsl/tools/fsleyes.py +++ b/fsl/tools/fsleyes.py @@ -21,6 +21,9 @@ See the :mod:`~fsl.fsleyes` package documentation for more details on """ +from __future__ import print_function + +import sys import logging import textwrap import argparse @@ -128,8 +131,14 @@ def context(args, splash): # force the creation of a wx.glcanvas.GLContext object, # and initialise OpenGL version-specific module loads. - fslgl.getWXGLContext(splash) - fslgl.bootstrap(args.glversion) + try: + fslgl.getWXGLContext(splash) + fslgl.bootstrap(args.glversion) + + except: + log.error('Unable to initialise OpenGL!', exc_info=True) + splash.Destroy() + sys.exit(1) # Redirect status updates # to the splash frame