File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -17181,17 +17181,25 @@ static int _python_get_variable_type(PyObject *variable_value)
1718117181 {
1718217182 LogMsg(INFO, "variable_value is a datetime object");
1718317183 PyObject *tzinfo = PyObject_GetAttrString(variable_value, "tzinfo");
17184+
17185+ #if defined(__MVS__)
1718417186 if (tzinfo && tzinfo != Py_None) {
1718517187 Py_DECREF(tzinfo);
17186- LogMsg(INFO, "variable_value is a datetime object ");
17188+ LogMsg(INFO, "datetime object has tzinfo on z/OS ");
1718717189 LogMsg(INFO, "exit _python_get_variable_type() with PYTHON_TIMESTAMP_TSTZ");
1718817190 return PYTHON_TIMESTAMP_TSTZ;
1718917191 } else {
1719017192 Py_XDECREF(tzinfo);
17191- LogMsg(INFO, "variable_value is a datetime object ");
17193+ LogMsg(INFO, "datetime object has no tzinfo on z/OS ");
1719217194 LogMsg(INFO, "exit _python_get_variable_type() with PYTHON_TIMESTAMP");
1719317195 return PYTHON_TIMESTAMP;
1719417196 }
17197+ #else
17198+ Py_XDECREF(tzinfo);
17199+ LogMsg(INFO, "datetime object on LUW (tzinfo ignored)");
17200+ LogMsg(INFO, "exit _python_get_variable_type() with PYTHON_TIMESTAMP");
17201+ return PYTHON_TIMESTAMP;
17202+ #endif
1719517203 }
1719617204 else if (PyTime_Check(variable_value))
1719717205 {
You can’t perform that action at this time.
0 commit comments