From: Marcin Koziej Date: Wed, 21 Dec 2011 08:28:43 +0000 (+0100) Subject: python 2.5 does not support tuple.index() X-Git-Tag: 1.7~180 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/e19936f58921288b8eea3b100960afd9863dea2e?ds=inline;hp=1f3e067b075c8c20609c4ebbada2c543f2717082 python 2.5 does not support tuple.index() --- diff --git a/librarian/dcparser.py b/librarian/dcparser.py index 245cf92..cf4a7b9 100644 --- a/librarian/dcparser.py +++ b/librarian/dcparser.py @@ -126,7 +126,7 @@ class Field(object): 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'): @@ -136,7 +136,7 @@ class DCInfo(type): except ValueError: fields = (field,) + fields - class_dict['FIELDS'] = fields + class_dict['FIELDS'] = tuple(fields) return super(DCInfo, meta).__new__(meta, classname, bases, class_dict)