[Biopython-dev] [Bug 2604] test_Restriction failure with Python 2.6 (also cause error in test_CAPS)

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Mon Oct 6 10:24:57 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2604





------- Comment #2 from biopython-bugzilla at maubp.freeserve.co.uk  2008-10-06 06:24 EST -------
I've contacted Frédéric Sohm by email, and this is his suggested fix for the
super issue:

--------------------------------------
I replaced line 221 :

super(RestrictionType, cls).__init__(name, bases, dict)

#dict was an error for dct by the way


By :

if sys.version < '2.6' :   # sys is imported at the beginning to check
                          # for set anyway.
    super(RestrictionType,cls).__init__(name, bases, dct)
else :
    super(RestrictionType,cls).__init__(cls, name, bases, dct)

# cls is the equivalent of self there. It's different to mark the fact
# that the class is a metaclass not a normal python class.

This should support both 2.6 and 2.3; The biopython test is now working with
2.6 (I did not try with 2.3 but this should not have changed anything for this
version). I have not much time for testing it thoroughly right now, sorry.
--------------------------------------
End quote.

Interestingly using the following, test_Restriction.py works on python 2.4:

super(RestrictionType,cls).__init__(cls, name, bases, dct)

This is consistent with the documentation Bruce found about arbitrary arguments
and keyword arguments being accepted and ignored before python 2.6.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list