remove obsoleted StandardError

This commit is contained in:
Tomas Kopecek 2017-03-07 14:32:50 +01:00 committed by Mike McLean
parent e355527649
commit 70224c42c1
5 changed files with 9 additions and 9 deletions

View file

@ -7520,7 +7520,7 @@ class QueryProcessor(object):
self.aliases = aliases
if columns and aliases:
if len(columns) != len(aliases):
raise StandardError('column and alias lists must be the same length')
raise Exception('column and alias lists must be the same length')
self.colsByAlias = dict(zip(aliases, columns))
else:
self.colsByAlias = {}
@ -7626,7 +7626,7 @@ SELECT %(col_str)s
elif order in self.columns:
orderCol = order
else:
raise StandardError('invalid order: ' + order)
raise Exception('invalid order: ' + order)
order_exprs.append(orderCol + direction)
return 'ORDER BY ' + ', '.join(order_exprs)
else:

View file

@ -57,19 +57,19 @@ class DBWrapper:
def __getattr__(self, key):
if not self.cnx:
raise StandardError('connection is closed')
raise Exception('connection is closed')
return getattr(self.cnx, key)
def cursor(self, *args, **kw):
if not self.cnx:
raise StandardError('connection is closed')
raise Exception('connection is closed')
return CursorWrapper(self.cnx.cursor(*args, **kw))
def close(self):
# Rollback any uncommitted changes and clear the connection so
# this DBWrapper is no longer usable after close()
if not self.cnx:
raise StandardError('connection is closed')
raise Exception('connection is closed')
self.cnx.cursor().execute('ROLLBACK')
#We do this rather than cnx.rollback to avoid opening a new transaction
#If our connection gets recycled cnx.rollback will be called then.

View file

@ -33,7 +33,7 @@ def CreateSSLContext(certs):
peer_ca_cert = certs['peer_ca_cert']
for f in key_and_cert, peer_ca_cert:
if f and not os.access(f, os.R_OK):
raise StandardError("%s does not exist or is not readable" % f)
raise Exception("%s does not exist or is not readable" % f)
ctx = SSL.Context(SSL.SSLv23_METHOD) # Use best possible TLS Method
ctx.use_certificate_file(key_and_cert)

View file

@ -129,7 +129,7 @@ def _assertLogin(environ):
session = environ['koji.session']
options = environ['koji.options']
if 'koji.currentLogin' not in environ or 'koji.currentUser' not in environ:
raise StandardError('_getServer() must be called before _assertLogin()')
raise Exception('_getServer() must be called before _assertLogin()')
elif environ['koji.currentLogin'] and environ['koji.currentUser']:
if options['WebCert']:
if not _sslLogin(environ, session, environ['koji.currentLogin']):

View file

@ -299,7 +299,7 @@ def paginateMethod(server, values, methodName, args=None, kw=None,
if not start or start < 0:
start = 0
if not dataName:
raise StandardError('dataName must be specified')
raise Exception('dataName must be specified')
kw['queryOpts'] = {'countOnly': True}
totalRows = getattr(server, methodName)(*args, **kw)
@ -329,7 +329,7 @@ def paginateResults(server, values, methodName, args=None, kw=None,
if not start or start < 0:
start = 0
if not dataName:
raise StandardError('dataName must be specified')
raise Exception('dataName must be specified')
kw['filterOpts'] = {'order': order,
'offset': start,