Skip to content

Commit

Permalink
CLN: move assignment from header into cython (pandas-dev#14731)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip authored and jreback committed Nov 25, 2016
1 parent 6ad6e4e commit 26a72e1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
3 changes: 0 additions & 3 deletions pandas/src/datetime.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ cdef extern from "datetime.h":
object PyDateTime_FromDateAndTime(int year, int month, int day, int hour,
int minute, int second, int us)

cdef extern from "datetime_helper.h":
void mangle_nat(object o)

cdef extern from "numpy/ndarrayobject.h":

ctypedef int64_t npy_timedelta
Expand Down
5 changes: 0 additions & 5 deletions pandas/src/datetime_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
#define PyInt_AS_LONG PyLong_AsLong
#endif

void mangle_nat(PyObject *val) {
PyDateTime_GET_MONTH(val) = -1;
PyDateTime_GET_DAY(val) = -1;
}

npy_int64 get_long_attr(PyObject *o, const char *attr) {
npy_int64 long_val;
PyObject *value = PyObject_GetAttrString(o, attr);
Expand Down
3 changes: 2 additions & 1 deletion pandas/tslib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,8 @@ class NaTType(_NaT):
cdef _NaT base

base = _NaT.__new__(cls, 1, 1, 1)
mangle_nat(base)
base._day = -1
base._month = -1
base.value = NPY_NAT

return base
Expand Down

0 comments on commit 26a72e1

Please sign in to comment.