summaryrefslogtreecommitdiff
path: root/silx/gui/_glutils
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>2019-12-23 13:45:09 +0100
committerPicca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>2019-12-23 13:45:09 +0100
commit5d647cf9a6159afd2933da594b9c79ad93d3cd9b (patch)
tree2571025a602f68fc8933b01104dc712d41f84034 /silx/gui/_glutils
parent654a6ac93513c3cc1ef97cacd782ff674c6f4559 (diff)
New upstream version 0.12.0~b0+dfsg
Diffstat (limited to 'silx/gui/_glutils')
-rw-r--r--silx/gui/_glutils/OpenGLWidget.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/silx/gui/_glutils/OpenGLWidget.py b/silx/gui/_glutils/OpenGLWidget.py
index 7f600a0..c5ece9c 100644
--- a/silx/gui/_glutils/OpenGLWidget.py
+++ b/silx/gui/_glutils/OpenGLWidget.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2017 European Synchrotron Radiation Facility
+# Copyright (c) 2017-2019 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -30,7 +30,7 @@ across Qt<=5.3 QtOpenGL.QGLWidget and QOpenGLWidget.
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "26/07/2017"
+__date__ = "22/11/2019"
import logging
@@ -192,7 +192,12 @@ else:
# Check OpenGL version
if self.getOpenGLVersion() >= self.getRequestedOpenGLVersion():
- version = gl.glGetString(gl.GL_VERSION)
+ try:
+ gl.glGetError() # clear any previous error (if any)
+ version = gl.glGetString(gl.GL_VERSION)
+ except:
+ version = None
+
if version:
self.__isValid = True
else: