Skip to content

Commit 9983b93

Browse files
Jonathan EliashivJonathan Eliashiv
authored andcommitted
this should fix the compiler complaints
1 parent 18a4bba commit 9983b93

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

pandas/_libs/src/ujson/python/objToJSON.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,13 @@ static TypeContext *createTypeContext(void) {
216216
return pc;
217217
}
218218

219-
static PyObject *get_tzinfo(PyObject *obj){
220-
if (PyObject_HasAttrString(obj, "tzinfo")){
221-
PyObject *tzinfo = PyObject_GetAttrString(obj, "tzinfo");
222-
return tzinfo;
223-
}
224-
return Py_None;
225-
}
219+
// static PyObject *get_tzinfo(PyObject *obj){
220+
// if (PyObject_HasAttrString(obj, "tzinfo")){
221+
// PyObject *tzinfo = PyObject_GetAttrString(obj, "tzinfo");
222+
// return tzinfo;
223+
// }
224+
// return Py_None;
225+
// }
226226

227227
static PyObject *get_values(PyObject *obj) {
228228
PyObject *values = NULL;

pandas/_libs/tslibs/src/datetime/np_datetime.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -795,19 +795,18 @@ int get_tzoffset_from_pytzinfo(PyObject *timezone_obj, npy_datetimestruct *dts)
795795
{
796796
PyDateTime_Date *dt;
797797
PyDateTime_Delta *tzoffset;
798-
npy_datetimestruct loc_dts;
799798

800799
/* Create a Python datetime to give to the timezone object */
801-
dt = PyDateTime_FromDateAndTimeAndZone((int)dts->year, dts->month, dts->day,
800+
dt = (PyDateTime_Date *) PyDateTime_FromDateAndTimeAndZone((int)dts->year, dts->month, dts->day,
802801
dts->hour, dts->min, 0, 0, timezone_obj);
803-
if (dt == NULL || !(PyDateTime_Check(dt))) {
802+
if (!(PyDateTime_Check(dt))) {
804803
Py_DECREF(dt);
805804
return -1;
806805
}
807-
tzoffset = PyObject_CallMethod(timezone_obj, "utcoffset", "O", dt);
806+
tzoffset = (PyDateTime_Delta *) PyObject_CallMethod(timezone_obj, "utcoffset", "O", dt);
808807

809808
Py_DECREF(dt);
810-
if ((tzoffset == Py_None || tzoffset == NULL) || !(PyDelta_Check(tzoffset))){
809+
if (!(PyDelta_Check(tzoffset))){
811810
Py_DECREF(tzoffset);
812811
return -1;
813812
}

0 commit comments

Comments
 (0)