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

wrapper for print_exc()

上级 c6d8c2d2
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Generate file lists used by apt-ftparchive to generate Packages and Sources files # Generate file lists used by apt-ftparchive to generate Packages and Sources files
# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> # 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 # 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 # it under the terms of the GNU General Public License as published by
...@@ -417,10 +417,7 @@ def main(): ...@@ -417,10 +417,7 @@ def main():
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])); projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
db_access.init(Cnf, projectB); db_access.init(Cnf, projectB);
Logger = logging.Logger(Cnf, "jenna"); Logger = logging.Logger(Cnf, "jenna");
try: utils.try_with_debug(do_da_do_da);
do_da_do_da();
except:
utils.print_exc();
Logger.close(); Logger.close();
######################################################################################### #########################################################################################
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Utility functions # Utility functions
# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org> # 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 # 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 # it under the terms of the GNU General Public License as published by
...@@ -643,6 +643,16 @@ def print_exc(): ...@@ -643,6 +643,16 @@ def print_exc():
################################################################################ ################################################################################
def try_with_debug(function):
try:
function();
except SystemExit:
raise;
except:
print_exc();
################################################################################
apt_pkg.init() apt_pkg.init()
Cnf = apt_pkg.newConfiguration(); Cnf = apt_pkg.newConfiguration();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册