本文整理匯總了Python中exceptions.StandardError方法的典型用法代碼示例。如果您正苦於以下問題:Python exceptions.StandardError方法的具體用法?Python exceptions.StandardError怎麽用?Python exceptions.StandardError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類exceptions
的用法示例。
在下文中一共展示了exceptions.StandardError方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: tearDown
# 需要導入模塊: import exceptions [as 別名]
# 或者: from exceptions import StandardError [as 別名]
def tearDown(self):
''' self.drivers should override this method to perform required cleanup
if any is necessary, such as deleting the test database.
The default drops the tables that may be created.
'''
try:
con = self._connect()
try:
cur = con.cursor()
for ddl in (self.xddl1,self.xddl2):
try:
cur.execute(ddl)
con.commit()
except self.driver.Error:
# Assume table didn't exist. Other tests will check if
# execute is busted.
pass
finally:
con.close()
except _BaseException:
pass