Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for float('-inf') under Python 2.5 on Windows

See also commit 60f28ef where
this same fix was used in Bio/HMM/MarkovModel.py
  • Loading branch information...
commit 34ba22d273ece10fb2f53f8fe01268d1ac7eaf32 1 parent c24a0b9
@peterjc peterjc authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 Bio/Motif/_Motif.py
View
7 Bio/Motif/_Motif.py
@@ -116,7 +116,12 @@ def consensus(self):
"""
sequence = ""
for i in range(self.length):
- maximum = float("-inf")
+ try:
+ maximum = float("-inf")
+ except ValueError:
+ # On Python 2.5 or older that was handled in C code,
+ # and failed on Windows XP 32bit
+ neg_inf = - 1E400
for letter in self.alphabet.letters:
count = self[letter][i]
if count > maximum:
Please sign in to comment.
Something went wrong with that request. Please try again.