From 0133ade440c0a1a4bce6703980ef7a10e13ea8d2 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Sun, 27 Mar 2011 12:01:46 -0500 Subject: [PATCH] Return None from bup_set_linux_file_attr() and bup_utimensat(). Return None from bup_set_linux_file_attr() and bup_utimensat() since errors are handled by exceptions. Signed-off-by: Rob Browning --- lib/bup/_helpers.c | 4 ++-- lib/bup/xstat.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/bup/_helpers.c b/lib/bup/_helpers.c index 5343b8d..2e7c6bf 100644 --- a/lib/bup/_helpers.c +++ b/lib/bup/_helpers.c @@ -679,7 +679,7 @@ static PyObject *bup_set_linux_file_attr(PyObject *self, PyObject *args) } close(fd); - return Py_BuildValue("i", 1); + return Py_BuildValue("O", Py_None); } #endif /* def linux */ @@ -754,7 +754,7 @@ static PyObject *bup_utimensat(PyObject *self, PyObject *args) if (rc != 0) return PyErr_SetFromErrnoWithFilename(PyExc_OSError, path); - return Py_BuildValue("i", 1); + return Py_BuildValue("O", Py_None); } #endif /* defined(_ATFILE_SOURCE) diff --git a/lib/bup/xstat.py b/lib/bup/xstat.py index bad1c27..c253370 100644 --- a/lib/bup/xstat.py +++ b/lib/bup/xstat.py @@ -36,12 +36,12 @@ if _have_utimensat: def lutime(path, times): atime = nsecs_to_timespec(times[0]) mtime = nsecs_to_timespec(times[1]) - return _helpers.utimensat(_helpers.AT_FDCWD, path, (atime, mtime), - _helpers.AT_SYMLINK_NOFOLLOW) + _helpers.utimensat(_helpers.AT_FDCWD, path, (atime, mtime), + _helpers.AT_SYMLINK_NOFOLLOW) def utime(path, times): atime = nsecs_to_timespec(times[0]) mtime = nsecs_to_timespec(times[1]) - return _helpers.utimensat(_helpers.AT_FDCWD, path, (atime, mtime), 0) + _helpers.utimensat(_helpers.AT_FDCWD, path, (atime, mtime), 0) else: def lutime(path, times): return None -- 2.39.2