diff options
| -rw-r--r-- | pyisda/credit_index.pyx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pyisda/credit_index.pyx b/pyisda/credit_index.pyx index 65dc439..ea1a809 100644 --- a/pyisda/credit_index.pyx +++ b/pyisda/credit_index.pyx @@ -111,8 +111,17 @@ cdef class CurveList: def __getitem__(self, tuple name not None): cdef: - char* buf = <char*>malloc(len(name[0]) + 3) - char* tmp + DocClause doc_clause + Seniority sen + str ticker + pair[CurveName, size_t] p + + try: + ticker, sen, doc_clause = name + except ValueError as e: + raise KeyError(str(e)) from None + cdef: + char* buf = <char*>malloc(len(ticker) + 3) buf[0] = <char>sen buf[1] = <char>doc_clause |
