diff --git a/gluon/contrib/gateways/fcgi.py b/gluon/contrib/gateways/fcgi.py index 239b13cb..69609696 100644 --- a/gluon/contrib/gateways/fcgi.py +++ b/gluon/contrib/gateways/fcgi.py @@ -1131,7 +1131,7 @@ class Server(object): is passed at initialization time, this must be implemented by a subclass. """ - raise NotImplementedError, self.__class__.__name__ + '.handler' + raise NotImplementedError(self.__class__.__name__ + '.handler') def error(self, req): """ diff --git a/gluon/contrib/pyrtf/Elements.py b/gluon/contrib/pyrtf/Elements.py index 9df7d1e5..40732cb1 100644 --- a/gluon/contrib/pyrtf/Elements.py +++ b/gluon/contrib/pyrtf/Elements.py @@ -415,7 +415,7 @@ class Image( RawCode ) : fin = infile if 'datatype' not in kwargs.keys(): msg = "If passing in a file object, you must also specify type='xxx' where xxx is one of %s" % self.PICT_TYPES.keys() - raise ValueError,msg + raise ValueError(msg) file_name = kwargs.pop('datatype') else: fin = file( infile, 'rb' ) diff --git a/gluon/contrib/spreadsheet.py b/gluon/contrib/spreadsheet.py index a85792e8..5317ef34 100644 --- a/gluon/contrib/spreadsheet.py +++ b/gluon/contrib/spreadsheet.py @@ -529,7 +529,7 @@ class Sheet: """ if not self.regex.match(key): - raise SyntaxError, "Invalid cell name: %s" % key + raise SyntaxError("Invalid cell name: %s" % key) else: attributes = self.get_attributes(kwarg) if attributes is not None: diff --git a/gluon/custom_import.py b/gluon/custom_import.py index 6d156dd6..93e46dd3 100644 --- a/gluon/custom_import.py +++ b/gluon/custom_import.py @@ -86,7 +86,7 @@ def custom_importer(name, globals=None, locals=None, fromlist=None, level=-1): try: result = result or sys.modules[modules_prefix+'.'+itemname] except KeyError as e: - raise ImportError, 'Cannot import module %s' % str(e) + raise ImportError('Cannot import module %s' % str(e)) modules_prefix += "." + itemname return result else: