summaryrefslogtreecommitdiffstats
path: root/legs.pyx
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@serenitascapital.com>2016-07-01 16:08:17 -0400
committerGuillaume Horel <guillaume.horel@serenitascapital.com>2016-07-01 16:08:17 -0400
commit104303510b747ffa31b96e44465eb5fdbd016304 (patch)
tree89fc56cb1faca2a3e3e6c4424dd7104f4d24908c /legs.pyx
parented83c435dcb32b5afd7f58a0fde72b41dc0d09e6 (diff)
downloadpyisda-104303510b747ffa31b96e44465eb5fdbd016304.tar.gz
more progress
Diffstat (limited to 'legs.pyx')
-rw-r--r--legs.pyx10
1 files changed, 8 insertions, 2 deletions
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),
<long>'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