diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2015-02-19 17:54:07 -0800 |
---|---|---|
committer | Dylan Baker <baker.dylan.c@gmail.com> | 2015-02-23 15:47:10 -0800 |
commit | 8279c52da3532b5f75428b84d6f605cd7a1addc8 (patch) | |
tree | 8f1292c5e61e5378817d5f03023eb82defa1e64d /registry | |
parent | e00ab80dbd85be38296ac6974613f30c6e906136 (diff) |
registry/gl.py: Don't try to compare None and not-None
Python2 allows the comparison of completely unlike types always. Often
the rules for these comparisons are surprising. None is one of the most
surprising comparisons you can make.
In python3 a much more sensible approach was taken, only related types
can be compared. So int and float can be compared, but int and None
cannot.
The solution here is to fail if the value is None, since the comparison
expects None to be less than the other value.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'registry')
-rw-r--r-- | registry/gl.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/registry/gl.py b/registry/gl.py index 43093a79e..288a4fcb2 100644 --- a/registry/gl.py +++ b/registry/gl.py @@ -100,9 +100,9 @@ def _repair_xml(xml_registry): continue if ('gles2_GL_ACTIVE_PROGRAM_EXT' in fixes - and enums.get('vendor') == 'ARB' - and enums.get('start') <= '0x8259' - and enums.get('end') >= '0x8259'): + and enums.get('vendor') is not None and enums.get('vendor') == 'ARB' + and enums.get('start') is not None and enums.get('start') <= '0x8259' + and enums.get('end') is not None and enums.get('end') >= '0x8259'): # GL_ACTIVE_PROGRAM_EXT has different numerical values in GL # (0x8B8D) and in GLES (0x8259). Remove the GLES value to avoid # redefinition collisions. |