Browse Source

Python 2.4 _and_ 2.5 support

Andrea Luzzardi 17 years ago
parent
commit
f66767dedc
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      tools/pamusb-agent

+ 7
- 2
tools/pamusb-agent View File

@ -25,9 +25,14 @@ import dbus
if getattr(dbus, 'version', (0,0,0)) >= (0,41,0): if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
import dbus.glib import dbus.glib
try: try:
import cElementTree as et
except ImportError:
# Python 2.5
import xml.etree.ElementTree as et 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: class HotPlugDevice:
def __init__(self, serial): def __init__(self, serial):


Loading…
Cancel
Save