From dfd5b5dc1be95ab59222a60db0361f26dd4ab8a1 Mon Sep 17 00:00:00 2001 From: KIU Shueng Chuan Date: Sat, 17 Jul 2021 16:06:44 +0800 Subject: [PATCH] fix attribute access in failure branch --- pyqtgraph/opengl/GLViewWidget.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/opengl/GLViewWidget.py b/pyqtgraph/opengl/GLViewWidget.py index 7e89f489..f931fd72 100644 --- a/pyqtgraph/opengl/GLViewWidget.py +++ b/pyqtgraph/opengl/GLViewWidget.py @@ -540,8 +540,8 @@ class GLViewWidget(QtWidgets.QOpenGLWidget): ## Test texture dimensions first glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGBA, texwidth, texwidth, 0, GL_RGBA, GL_UNSIGNED_BYTE, None) if glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH) == 0: - raise Exception("OpenGL failed to create 2D texture (%dx%d); too large for this hardware." % shape[:2]) - ## create teture + raise RuntimeError("OpenGL failed to create 2D texture (%dx%d); too large for this hardware." % data.shape[:2]) + ## create texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texwidth, texwidth, 0, GL_RGBA, GL_UNSIGNED_BYTE, data.transpose((1,0,2))) # Create depth buffer