From 104303510b747ffa31b96e44465eb5fdbd016304 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Fri, 1 Jul 2016 16:08:17 -0400 Subject: more progress --- legs.pyx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'legs.pyx') diff --git a/legs.pyx b/legs.pyx index 5db39d3..27bcf19 100644 --- a/legs.pyx +++ b/legs.pyx @@ -14,6 +14,9 @@ cdef class ContingentLeg: pydate_to_TDate(end_date), notional, protect_start) + if self._thisptr is NULL: + raise ValueError + def __dealloc__(self): if self._thisptr is not NULL: free(self._thisptr) @@ -38,14 +41,17 @@ cdef class FeeLeg: coupon_rate, dcc(payment_dcc), 'M', - NULL, + b'NONE', protect_start) + if self._thisptr is NULL: + raise ValueError + @property def cashflows(self): cdef TCashFlowList* cfl = JpmcdsFeeLegFlows(self._thisptr) cdef TCashFlow cf result = [] - for i in range(cf.fNumItems): + for i in range(cfl.fNumItems): cf = cfl.fArray[i] result.append((TDate_to_pydate(cf.fDate), cf.fAmount)) return result -- cgit v1.2.3-70-g09d2