[Biopython-dev] test_PhyloXML.py on Python 3

Peter biopython at maubp.freeserve.co.uk
Tue Aug 17 12:37:52 EDT 2010


On Tue, Aug 17, 2010 at 4:47 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
> On Tue, Aug 17, 2010 at 12:25 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
>>
>> The resulting code is a little different from my auto2to3 branch - all to do
>> with long/int changes. I think my script was keeping the unwanted fixes to
>> Bio/Phylo/PhyloXML.py as well as the useful fixes made to these files:
>>
>> * Bio/SeqIO/InsdcIO.py - testing for isinstance of int or long
>> * BioSQL/Loader.py - testing for isinstance of int or long
>> * Bio/Prosite/Prodoc.py - using long(handle.tell())
>> * Bio/Prosite/__init__.py - using long(handle.tell())
>
> And also:
> * Bio/SwissProt/SProt.py - using long(handle.tell())
> * Bio/Blast/NCBIStandalone.py - using long(float(...))
>
> I still think all these can be fixed to work without needing the 2to3 long
> fixer.

Handling testing for int/long is done,
http://github.com/biopython/biopython/commit/ddaf587afd02aa7214e53647c48e4089555e7efb

And I replaced the use of long in Bio/Blast/NCBIStandalone.py with int(),
http://github.com/biopython/biopython/commit/e095370184fc2ab50b37bbd86667f762ca825107

The other three uses of long I identified can probably be solved
neatly like this:

try:
    end = long(handle.tell())
except NameError:
    #Python 3 where 2to3 long fixer was disabled
    end = handle.tell()

Peter


More information about the Biopython-dev mailing list