summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2011-11-07 16:51:18 (GMT)
committerBrian Curtin <brian@python.org>2011-11-07 16:51:18 (GMT)
commitb0d5b5d3b2a3a9047e3fe87c118e723c5876b92a (patch)
tree7adefd6950e844259b1ebeeb78a7e56d1964c0b4
parente2618f34be2deb65799ccf073933cd61b443efd4 (diff)
downloadcpython-b0d5b5d3b2a3a9047e3fe87c118e723c5876b92a.zip
cpython-b0d5b5d3b2a3a9047e3fe87c118e723c5876b92a.tar.gz
cpython-b0d5b5d3b2a3a9047e3fe87c118e723c5876b92a.tar.bz2
Adjust None handling to be a bit more clean. Thanks to Benjamin
for pointing it out.
-rw-r--r--Modules/posixmodule.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 2e33022..5ca9e95 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3543,7 +3543,7 @@ static PyObject *
posix_utime(PyObject *self, PyObject *args)
{
#ifdef MS_WINDOWS
- PyObject *arg = NULL;
+ PyObject *arg = Py_None;
PyObject *obwpath;
wchar_t *wpath = NULL;
PyObject *oapath;
@@ -3589,7 +3589,7 @@ posix_utime(PyObject *self, PyObject *args)
Py_DECREF(oapath);
}
- if (!arg || (arg == Py_None)) {
+ if (arg == Py_None) {
SYSTEMTIME now;
GetSystemTime(&now);
if (!SystemTimeToFileTime(&now, &mtime) ||
@@ -3633,13 +3633,13 @@ done:
time_t atime, mtime;
long ausec, musec;
int res;
- PyObject* arg = NULL;
+ PyObject* arg = Py_None;
if (!PyArg_ParseTuple(args, "O&|O:utime",
PyUnicode_FSConverter, &opath, &arg))
return NULL;
path = PyBytes_AsString(opath);
- if (!arg || (arg == Py_None)) {
+ if (arg == Py_None) {
/* optional time values not given */
Py_BEGIN_ALLOW_THREADS
res = utime(path, NULL);