python 2.5 does not support tuple.index()
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Wed, 21 Dec 2011 08:28:43 +0000 (09:28 +0100)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Wed, 21 Dec 2011 08:28:43 +0000 (09:28 +0100)
librarian/dcparser.py

index 245cf92..cf4a7b9 100644 (file)
@@ -126,7 +126,7 @@ class Field(object):
 
 class DCInfo(type):
     def __new__(meta, classname, bases, class_dict):
 
 class DCInfo(type):
     def __new__(meta, classname, bases, class_dict):
-        fields = class_dict['FIELDS']
+        fields = list(class_dict['FIELDS'])
 
         for base in bases[::-1]:
             if hasattr(base, 'FIELDS'):
 
         for base in bases[::-1]:
             if hasattr(base, 'FIELDS'):
@@ -136,7 +136,7 @@ class DCInfo(type):
                     except ValueError:
                         fields = (field,) + fields
 
                     except ValueError:
                         fields = (field,) + fields
 
-        class_dict['FIELDS'] = fields
+        class_dict['FIELDS'] = tuple(fields)
         return super(DCInfo, meta).__new__(meta, classname, bases, class_dict)
 
 
         return super(DCInfo, meta).__new__(meta, classname, bases, class_dict)