@@ -467,7 +467,7 @@ cdef int check_constraint(double val, object name, constraint_type cons) except
467467 # Note: Assume value is integral (double of LONG_MAX should work out)
468468 if val < 0 :
469469 raise ValueError (name + " < 0" )
470- elif val > LONG_MAX :
470+ elif val > < double > LONG_MAX :
471471 raise ValueError (
472472 name + " is out of bounds for long, consider using "
473473 "the new generator API for 64bit integers." )
@@ -918,31 +918,33 @@ cdef object disc(void *func, void *state, object size, object lock,
918918 else :
919919 raise NotImplementedError ("No vector path available" )
920920
921+ # At this point, we know is_scalar is True.
922+
921923 if narg_double > 0 :
922924 _da = PyFloat_AsDouble (a )
923- if a_constraint != CONS_NONE and is_scalar :
925+ if a_constraint != CONS_NONE :
924926 check_constraint (_da , a_name , a_constraint )
925927
926928 if narg_double > 1 :
927929 _db = PyFloat_AsDouble (b )
928- if b_constraint != CONS_NONE and is_scalar :
930+ if b_constraint != CONS_NONE :
929931 check_constraint (_db , b_name , b_constraint )
930932 elif narg_int64 == 1 :
931933 _ib = < int64_t > b
932- if b_constraint != CONS_NONE and is_scalar :
934+ if b_constraint != CONS_NONE :
933935 check_constraint (< double > _ib , b_name , b_constraint )
934936 else :
935937 if narg_int64 > 0 :
936938 _ia = < int64_t > a
937- if a_constraint != CONS_NONE and is_scalar :
939+ if a_constraint != CONS_NONE :
938940 check_constraint (< double > _ia , a_name , a_constraint )
939941 if narg_int64 > 1 :
940942 _ib = < int64_t > b
941- if b_constraint != CONS_NONE and is_scalar :
943+ if b_constraint != CONS_NONE :
942944 check_constraint (< double > _ib , b_name , b_constraint )
943945 if narg_int64 > 2 :
944946 _ic = < int64_t > c
945- if c_constraint != CONS_NONE and is_scalar :
947+ if c_constraint != CONS_NONE :
946948 check_constraint (< double > _ic , c_name , c_constraint )
947949
948950 if size is None :
0 commit comments