From 829def8f486e188d085b0c79463725b50e304352 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 10 May 2021 00:22:52 +0800 Subject: [PATCH] up --- plugins/gogs/class/mysqlDb.py | 12 ++++++------ plugins/gogs/index.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/gogs/class/mysqlDb.py b/plugins/gogs/class/mysqlDb.py index dd813fc1c..69e7644cd 100755 --- a/plugins/gogs/class/mysqlDb.py +++ b/plugins/gogs/class/mysqlDb.py @@ -4,7 +4,7 @@ import re import os import sys -sys.path.append("/usr/local/lib/python2.7/site-packages") +# sys.path.append("/usr/local/lib/python3.6/site-packages") class mysqlDb: @@ -24,20 +24,20 @@ class mysqlDb: socket = '/tmp/mysql.sock' try: import MySQLdb - except Exception, ex: + except Exception as ex: self.__DB_ERR = ex return False try: self.__DB_CONN = MySQLdb.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS, port=self.__DB_PORT, db=self.__DB_NAME, charset="utf8", connect_timeout=10, unix_socket=socket) - except MySQLdb.Error, e: + except MySQLdb.Error as e: self.__DB_HOST = '127.0.0.1' self.__DB_CONN = MySQLdb.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS, port=self.__DB_PORT, db=self.__DB_NAME, charset="utf8", connect_timeout=10, unix_socket=socket) self.__DB_CUR = self.__DB_CONN.cursor() return True - except MySQLdb.Error, e: + except MySQLdb.Error as e: self.__DB_ERR = e return False @@ -68,7 +68,7 @@ class mysqlDb: self.__DB_CONN.commit() self.__Close() return result - except Exception, ex: + except Exception as ex: return ex def query(self, sql): @@ -82,7 +82,7 @@ class mysqlDb: data = map(list, result) self.__Close() return data - except Exception, ex: + except Exception as ex: return ex # 关闭连接 diff --git a/plugins/gogs/index.py b/plugins/gogs/index.py index f40cdd52a..f832624c8 100755 --- a/plugins/gogs/index.py +++ b/plugins/gogs/index.py @@ -6,7 +6,7 @@ import os import sys import re -sys.path.append("/usr/local/lib/python2.7/site-packages") +# sys.path.append("/usr/local/lib/python3.6/site-packages") import psutil sys.path.append(os.getcwd() + "/class/core")