提交 9de8be4a 编写于 作者: J James Troup

wrapper for print_exc()

上级 c6d8c2d2
......@@ -2,7 +2,7 @@
# Generate file lists used by apt-ftparchive to generate Packages and Sources files
# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
# $Id: jenna,v 1.22 2002-11-22 04:06:32 troup Exp $
# $Id: jenna,v 1.23 2002-11-26 15:49:16 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -417,10 +417,7 @@ def main():
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
db_access.init(Cnf, projectB);
Logger = logging.Logger(Cnf, "jenna");
try:
do_da_do_da();
except:
utils.print_exc();
utils.try_with_debug(do_da_do_da);
Logger.close();
#########################################################################################
......
......@@ -2,7 +2,7 @@
# Utility functions
# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
# $Id: utils.py,v 1.52 2002-11-22 04:06:34 troup Exp $
# $Id: utils.py,v 1.53 2002-11-26 15:49:16 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -643,6 +643,16 @@ def print_exc():
################################################################################
def try_with_debug(function):
try:
function();
except SystemExit:
raise;
except:
print_exc();
################################################################################
apt_pkg.init()
Cnf = apt_pkg.newConfiguration();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册