From 733e2d5e697395754fe5e03a7449682cc758b3e6 Mon Sep 17 00:00:00 2001 From: Nicolas Dandrimont Date: Sat, 10 Jan 2009 15:01:36 +0100 Subject: [PATCH] [gestion/darcs_send_changes] Utilisation de cElementTree pour ragnarok darcs-hash:20090110140136-ffbb2-85460af2f8981c3a6bc713da283f43c683c3ec69.gz --- gestion/darcs_send_changes.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gestion/darcs_send_changes.py b/gestion/darcs_send_changes.py index ea7c35c2..3689a965 100755 --- a/gestion/darcs_send_changes.py +++ b/gestion/darcs_send_changes.py @@ -5,7 +5,7 @@ # --------------------- # # Copyright (C) 2007 Jeremie Dimino -# Copyright (C) 2007 Nicolas Dandrimont +# Copyright (C) 2007,2008 Nicolas Dandrimont # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,10 +30,13 @@ import commands, os, sys, email try: from lxml import etree -except: - sys.stderr.write("darcs_send_changes requiert le paquet python-lxml.\n") - sys.stderr.flush() - sys.exit(1) +except ImportError: + try: + import cElementTree as etree + except ImportError: + sys.stderr.write("darcs_send_changes requiert python-lxml ou cElementTree.\n") + sys.stderr.flush() + sys.exit(1) sys.path.append("/usr/scripts/gestion") from affich_tools import cprint, encoding