Skip to content

Commit 82299ee

Browse files
committed
emit more useful error message, closes #4
1 parent a36da25 commit 82299ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

affinegap/affinegap.pyx

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# cython: boundscheck=False, wraparound=False
2-
# cython: cdivision=False
2+
# cython: cdivision=True
33
# cython: c_string_type=unicode, c_string_encoding=utf8
44
# cython: language_level=3
55

@@ -120,6 +120,9 @@ cpdef float normalizedAffineGapDistance(str string_a, str string_b,
120120

121121
cdef float normalizer = length1 + length2
122122

123+
if normalizer == 0:
124+
raise ZeroDivisionError('normalizedAffineGapDistance cannot take two empty strings')
125+
123126
cdef float distance = affineGapDistance(string_a, string_b,
124127
matchWeight,
125128
mismatchWeight,

0 commit comments

Comments
 (0)