diff --git a/OpenGL/GL/ARB/shader_objects.py b/OpenGL/GL/ARB/shader_objects.py index fd6b7a37..1f3db4c8 100644 --- a/OpenGL/GL/ARB/shader_objects.py +++ b/OpenGL/GL/ARB/shader_objects.py @@ -248,8 +248,8 @@ def glGetActiveUniformARB(baseOperation,program, index,bufSize=None): bufSize = int(glGetObjectParameterivARB( program, GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB)) if index < max_index and index >= 0: length,name,size,type = baseOperation( program, index, bufSize ) - if hasattr(name,'tostring'): - name = name.tostring().rstrip(b'\000') + if hasattr(name,'tobytes'): + name = name.tobytes().rstrip(b'\000') elif hasattr(name,'value'): name = name.value return name,size,type diff --git a/OpenGL/GL/ARB/vertex_shader.py b/OpenGL/GL/ARB/vertex_shader.py index b8c05e2f..c372c6a7 100644 --- a/OpenGL/GL/ARB/vertex_shader.py +++ b/OpenGL/GL/ARB/vertex_shader.py @@ -135,8 +135,8 @@ def glGetActiveAttribARB(baseOperation, program, index): length = int(glGetObjectParameterivARB( program, GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB)) if index < max_index and index >= 0 and length > 0: length,name,size,type = baseOperation( program, index ) - if hasattr(name,'tostring'): - name = name.tostring().rstrip(b'\000') + if hasattr(name,'tobytes'): + name = name.tobytes().rstrip(b'\000') elif hasattr(name,'value'): name = name.value return name,size,type diff --git a/OpenGL/GL/VERSION/GL_2_0.py b/OpenGL/GL/VERSION/GL_2_0.py index f34bfda1..691198d5 100644 --- a/OpenGL/GL/VERSION/GL_2_0.py +++ b/OpenGL/GL/VERSION/GL_2_0.py @@ -379,8 +379,8 @@ def glGetActiveAttrib(baseOperation, program, index, bufSize=None,*args): if bufSize <= 0: raise RuntimeError( 'Active attribute length reported', bufsize ) name,size,type = baseOperation( program, index, bufSize, *args )[1:] - if hasattr(name,'tostring'): - name = name.tostring().rstrip(b'\000') + if hasattr(name,'tobytes'): + name = name.tobytes().rstrip(b'\000') elif hasattr(name,'value'): name = name.value return name,size,type @@ -408,8 +408,8 @@ def glGetActiveUniform(baseOperation,program, index,bufSize=None,*args): bufSize = int(glGetProgramiv( program, GL_ACTIVE_UNIFORM_MAX_LENGTH)) if index < max_index and index >= 0: length,name,size,type = baseOperation( program, index, bufSize, *args ) - if hasattr(name,'tostring'): - name = name.tostring().rstrip(b'\000') + if hasattr(name,'tobytes'): + name = name.tobytes().rstrip(b'\000') elif hasattr(name,'value'): name = name.value return name,size,type diff --git a/OpenGL/GLES2/VERSION/GLES2_2_0.py b/OpenGL/GLES2/VERSION/GLES2_2_0.py index 57cda60e..99e94892 100644 --- a/OpenGL/GLES2/VERSION/GLES2_2_0.py +++ b/OpenGL/GLES2/VERSION/GLES2_2_0.py @@ -353,8 +353,8 @@ def glGetActiveUniform(baseOperation,program, index,bufSize=None,*args): bufSize = int(glGetProgramiv( program, GL_ACTIVE_UNIFORM_MAX_LENGTH)) if index < max_index and index >= 0: length,name,size,type = baseOperation( program, index, bufSize, *args ) - if hasattr(name,'tostring'): - name = name.tostring().rstrip(b'\000') + if hasattr(name,'tobytes'): + name = name.tobytes().rstrip(b'\000') elif hasattr(name,'value'): name = name.value return name,size,type @@ -383,8 +383,8 @@ def glGetActiveAttrib(baseOperation, program, index, bufSize=None,*args): if bufSize <= 0: raise RuntimeError( 'Active attribute length reported', bufsize ) name,size,type = baseOperation( program, index, bufSize, *args )[1:] - if hasattr(name,'tostring'): - name = name.tostring().rstrip(b'\000') + if hasattr(name,'tobytes'): + name = name.tobytes().rstrip(b'\000') elif hasattr(name,'value'): name = name.value return name,size,type diff --git a/OpenGL/arrays/strings.py b/OpenGL/arrays/strings.py index 79850ac5..2da2e7c5 100644 --- a/OpenGL/arrays/strings.py +++ b/OpenGL/arrays/strings.py @@ -56,8 +56,8 @@ def asArray(self, value, typeCode=None): """Convert given value to an array value of given typeCode""" if isinstance(value, bytes): return value - elif hasattr(value, 'tostring'): - return value.tostring() + elif hasattr(value, 'tobytes'): + return value.tobytes() elif hasattr(value, 'raw'): return value.raw # could convert types to string here, but we're not registered for