# HG changeset patch
# User Jan Kanis <jan.code@jankanis.nl>
# Date 1406824828 -7200
# Node ID 720efb818f1b9486b816e4a215f6fc6c136c85ec
# Parent  5f104d05aa23b1c55dc448d6d645097390339b7e
really fix python 2.6 array type code issue

diff -r 5f104d05aa23 -r 720efb818f1b blast2html.py
--- a/blast2html.py	Thu Jul 31 17:24:10 2014 +0200
+++ b/blast2html.py	Thu Jul 31 18:40:28 2014 +0200
@@ -329,9 +329,10 @@
             hsps = hit.Hit_hsps.Hsp
 
             # In python 2.6 array doesn't accept unicode type codes, but in 3.4 it requires them
-            cover = array(str('B'), [0]) * query_length
+            typecode_B = builtin_str('B')
+            cover = array(typecode_B, [0]) * query_length
             for hsp in hsps:
-                cover[hsp['Hsp_query-from']-1 : int(hsp['Hsp_query-to'])] = array(str('B'), [1]) * blastxml_len(hsp)
+                cover[hsp['Hsp_query-from']-1 : int(hsp['Hsp_query-to'])] = array(typecode_B, [1]) * blastxml_len(hsp)
             cover_count = cover.count(1)
 
             best_hsp = max(hsps, key=lambda h: h['Hsp_bit-score'])