From cdb8cc5490b017080be0678c10f37af4a68223d8 Mon Sep 17 00:00:00 2001 From: Marian Beermann Date: Sun, 22 May 2016 19:54:08 +0200 Subject: [PATCH] Fix referencing error in platform_linux.set_flags --- borg/platform_linux.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/borg/platform_linux.pyx b/borg/platform_linux.pyx index 707766b1a..a1c549338 100644 --- a/borg/platform_linux.pyx +++ b/borg/platform_linux.pyx @@ -76,8 +76,9 @@ def set_flags(path, bsd_flags, fd=None): fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) try: if ioctl(fd, FS_IOC_SETFLAGS, &flags) == -1: - if errno.errno != errno.EOPNOTSUPP: - raise OSError(errno, strerror(errno).decode(), path) + error_number = errno.errno + if error_number != errno.EOPNOTSUPP: + raise OSError(error_number, strerror(error_number).decode(), path) finally: if open_fd: os.close(fd)