示例#1
0
 def go(*args, **kw):
     try:
         ret = f(*args, **kw)
         db.commit()
         return ret
     except:
         db.rollback()
         db.close()
         raise
示例#2
0
 def handle_500(e):
     # shit
     try:
         db.rollback()
         db.close()
     except:
         # shit shit
         sys.exit(1)
     return render_template("internal_error.html"), 500
示例#3
0
文件: common.py 项目: minus7/sr.ht
 def go(*args, **kw):
     try:
         ret = f(*args, **kw)
         db.commit()
         return ret
     except:
         db.rollback()
         db.close()
         raise
示例#4
0
文件: app.py 项目: lzimann/sr.ht
 def handle_500(e):
     # shit
     try:
         db.rollback()
         db.close()
     except:
         # shit shit
         sys.exit(1)
     return render_template("internal_error.html"), 500