Skip to content

Commit

Permalink
FIX regular expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
rougier committed Feb 22, 2014
1 parent 20aaa66 commit 1340f50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vispy/gloo/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def active_uniforms(self):
name, size, gtype = gl.glGetActiveUniform(self.handle, i)
# This checks if the uniform is an array
# Name will be something like xxx[0] instead of xxx
m = regex.match(name)
m = regex.match(name.decode('utf-8'))
# When uniform is an array, size corresponds to the highest used
# index
if m:
Expand Down Expand Up @@ -342,7 +342,7 @@ def active_attributes(self):

# This checks if the attribute is an array
# Name will be something like xxx[0] instead of xxx
m = regex.match(name)
m = regex.match(name.decode('utf-8'))
# When attribute is an array, size corresponds to the highest used
# index
if m:
Expand Down Expand Up @@ -393,7 +393,9 @@ def draw(self, mode=gl.GL_TRIANGLES, indices=None):
"""

self.activate()
attributes = self._attributes.values()

# WARNING: The "list" of values from a dict is not a list

This comment has been minimized.

Copy link
@larsoner

larsoner Feb 23, 2014

Member

Might want to add on Py3k or similar here, because IIRC that's when it changed

This comment has been minimized.

Copy link
@almarklein

almarklein Feb 25, 2014

Member

@Eric89GXL Feel free to commit trivial cases such as this directly to the repo

This comment has been minimized.

Copy link
@rossant

rossant Feb 25, 2014

Member

@almarklein I don't know. Doing PRs for all changes may be a good habit to take. Look at this for instance. ;)

This comment has been minimized.

Copy link
@almarklein

almarklein Feb 25, 2014

Member

@rossant What about any commit that changes executable code needs review, but commits that only change comments and/or docs are ok to push directly?

This comment has been minimized.

Copy link
@rossant

rossant Feb 25, 2014

Member

Maybe things like typos or minor rephrasing in comments/docs are ok, but probably larger changes should be reviewed. @Eric89GXL what do you think?

This comment has been minimized.

Copy link
@larsoner

larsoner Feb 25, 2014

Member

I like the idea that pushes to master should be restricted to minor code comment fixes like this one or typos as much as possible. On other projects I have made what I thought were fairly minor changes right in master that ended up breaking things, and seen other people do the same. It's just too easy to do just through minor misunderstandings (or introducing new typos). For something like comments though, the risk of such minor errors breaking execution is fairly low.

In cases where code must be pushed directly to master (comments or otherwise), it can also be helpful sometimes to CC people who typically work on the code by commenting on the change on Github after it's made, just so they are aware of the change.

attributes = list(self._attributes.values())

# Get buffer size first attribute
# We need more tests here
Expand Down
1 change: 1 addition & 0 deletions vispy/gloo/shader.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def _create(self):
status = gl.glGetShaderiv(self._handle, gl.GL_COMPILE_STATUS)
if not status:
error = gl.glGetShaderInfoLog(self._handle)
error = error.decode('utf-8')
lineno, mesg = self._parse_error(error)
self._print_error(mesg, lineno - 1)
raise RuntimeError("Shader compilation error")
Expand Down

0 comments on commit 1340f50

Please sign in to comment.