From f66767dedc5c05e112063a079abffd0796e7bf32 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Thu, 19 Jul 2007 21:18:52 +0000 Subject: [PATCH] Python 2.4 _and_ 2.5 support --- tools/pamusb-agent | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/pamusb-agent b/tools/pamusb-agent index 4d5742f..1cb30bf 100755 --- a/tools/pamusb-agent +++ b/tools/pamusb-agent @@ -25,9 +25,14 @@ import dbus if getattr(dbus, 'version', (0,0,0)) >= (0,41,0): import dbus.glib try: - import cElementTree as et -except ImportError: + # Python 2.5 import xml.etree.ElementTree as et +except ImportError: + # Python 2.4 + try: + import cElementTree as et + except ImportError: + import elementtree.ElementTree as et class HotPlugDevice: def __init__(self, serial):