summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-12-02 16:32:08 +0000
committerLars Wirzenius <liw@liw.fi>2012-12-02 16:32:08 +0000
commitc187f9f4b3ab2824a0f5e3d25a3133504dc36c8e (patch)
tree1a7ae681b5e60cb5ad44fd40d03489c69bae8403
parentae6880098b94135a71add7b390f773ec00c55452 (diff)
downloadobnam-c187f9f4b3ab2824a0f5e3d25a3133504dc36c8e.tar.gz
Fix creation of OSError instances
-rw-r--r--obnamlib/vfs.py2
-rw-r--r--obnamlib/vfs_local.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/obnamlib/vfs.py b/obnamlib/vfs.py
index 9ea90365..732b62af 100644
--- a/obnamlib/vfs.py
+++ b/obnamlib/vfs.py
@@ -638,7 +638,7 @@ class VfsTests(object): # pragma: no cover
def test_scan_tree_returns_nothing_if_listdir_fails(self):
self.set_up_scan_tree()
def raiser(dirname):
- raise OSError((123, 'oops', dirname))
+ raise OSError(123, 'oops', dirname)
def logerror(msg):
pass
self.fs.listdir2 = raiser
diff --git a/obnamlib/vfs_local.py b/obnamlib/vfs_local.py
index 9b456f9f..e9b456c5 100644
--- a/obnamlib/vfs_local.py
+++ b/obnamlib/vfs_local.py
@@ -133,7 +133,7 @@ class LocalFS(obnamlib.VirtualFileSystem):
atime_sec, atime_nsec, mtime_sec, mtime_nsec,
ctime_sec, ctime_nsec) = obnamlib._obnam.lstat(self.join(pathname))
if ret != 0:
- raise OSError((ret, os.strerror(ret), pathname))
+ raise OSError(ret, os.strerror(ret), pathname)
return obnamlib.Metadata(
st_dev=dev,
st_ino=ino,
@@ -162,7 +162,7 @@ class LocalFS(obnamlib.VirtualFileSystem):
def llistxattr(self, filename): # pragma: no cover
ret = obnamlib._obnam.llistxattr(self.join(filename))
if type(ret) is int:
- raise OSError((ret, os.strerror(ret), filename))
+ raise OSError(ret, os.strerror(ret), filename)
return [s for s in ret.split('\0') if s]
def lgetxattr(self, filename, attrname): # pragma: no cover
@@ -175,7 +175,7 @@ class LocalFS(obnamlib.VirtualFileSystem):
ret = obnamlib._obnam.lsetxattr(self.join(filename),
attrname, attrvalue)
if ret != 0:
- raise OSError((ret, os.strerror(ret), filename))
+ raise OSError(ret, os.strerror(ret), filename)
def lchown(self, pathname, uid, gid): # pragma: no cover
tracing.trace('lchown %s %d %d', pathname, uid, gid)