File tree 1 file changed +3
-4
lines changed 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
try :
2
2
from xml .etree import ElementTree
3
- except NameError :
3
+ except ImportError :
4
4
from elementtree import ElementTree
5
5
6
6
import base
@@ -20,16 +20,15 @@ def _getName(self):
20
20
name = property (_getName , _setName )
21
21
22
22
def _getAttributes (self ):
23
- #Just return the _element which implements a dict-like interface to the attributes
24
- return self ._element
23
+ return self ._element .attrib
25
24
26
25
def _setAttributes (self , attributes ):
27
26
#Delete existing attributes first
28
27
#XXX - there may be a better way to do this...
29
28
for key in self ._element .attrib .keys ():
30
29
del self ._element .attrib [key ]
31
30
for key , value in attributes .iteritems ():
32
- self ._elements .set (key ) = value
31
+ self ._elements .set (key , value )
33
32
34
33
attributes = property (_getAttributes , _setAttributes )
35
34
You can’t perform that action at this time.
0 commit comments