python: Stop using the Python 2 exception syntax

We could have made this compatible with Python 3 by using:

    except Exception as e:

But since none of this code actually uses the exception objects, let's
just drop them entirely.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Mathieu Bridon 2018-07-06 12:13:36 +02:00 committed by Dylan Baker
parent e5a8d51e54
commit b39bdb0716
5 changed files with 7 additions and 7 deletions

View file

@ -470,7 +470,7 @@ class glx_function(gl_XML.gl_function):
def needs_reply(self):
try:
x = self._needs_reply
except Exception, e:
except Exception:
x = 0
if self.return_type != 'void':
x = 1

View file

@ -284,7 +284,7 @@ def classify_category(name, number):
try:
core_version = float(name)
except Exception,e:
except Exception:
core_version = 0.0
if core_version > 0.0:
@ -365,7 +365,7 @@ class gl_enum( gl_item ):
else:
try:
c = int(temp)
except Exception,e:
except Exception:
raise RuntimeError('Invalid count value "%s" for enum "%s" in function "%s" when an integer was expected.' % (temp, self.name, n))
self.default_count = c
@ -426,7 +426,7 @@ class gl_parameter(object):
count = int(c)
self.count = count
self.counter = None
except Exception,e:
except Exception:
count = 1
self.count = 0
self.counter = c

View file

@ -353,7 +353,7 @@ if __name__ == '__main__':
try:
(args, trail) = getopt.getopt(sys.argv[1:], 'm:f:')
except Exception,e:
except Exception:
show_usage()
for (arg,val) in args:

View file

@ -74,7 +74,7 @@ if __name__ == '__main__':
try:
(args, trail) = getopt.getopt(sys.argv[1:], 'm:f:')
except Exception,e:
except Exception:
show_usage()
for (arg,val) in args:

View file

@ -201,7 +201,7 @@ def show_usage():
if __name__ == '__main__':
try:
(opts, args) = getopt.getopt(sys.argv[1:], "f:")
except Exception,e:
except Exception:
show_usage()
if len(args) != 0: