summaryrefslogtreecommitdiff
path: root/fs/memoryfs.py
diff options
context:
space:
mode:
authorrfkelly0 <rfkelly0@67cdc799-7952-0410-af00-57a81ceafa0f>2010-02-16 00:27:08 +0000
committerrfkelly0 <rfkelly0@67cdc799-7952-0410-af00-57a81ceafa0f>2010-02-16 00:27:08 +0000
commit660f4c74c7ba1b54405ef0a467df0d5a122fd891 (patch)
treed8d39dc623b61195bf2ada7c3c6e592e919fd140 /fs/memoryfs.py
parent012495ddd5eb73e5e9481644d303549cc31e98c5 (diff)
downloadpyfilesystem-660f4c74c7ba1b54405ef0a467df0d5a122fd891.tar.gz
ensure that rename() raises ParentDirectoryMissingError when appropriate
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@326 67cdc799-7952-0410-af00-57a81ceafa0f
Diffstat (limited to 'fs/memoryfs.py')
-rw-r--r--fs/memoryfs.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/memoryfs.py b/fs/memoryfs.py
index c72afac..f64ee9f 100644
--- a/fs/memoryfs.py
+++ b/fs/memoryfs.py
@@ -414,6 +414,8 @@ class MemoryFS(FS):
src_dir_entry = self._get_dir_entry(src_dir)
dst_dir_entry = self._get_dir_entry(dst_dir)
+ if dst_dir_entry is None:
+ raise ParentDirectoryMissingError(dst)
dst_dir_entry.contents[dst_name] = src_dir_entry.contents[src_name]
dst_dir_entry.contents[dst_name].name = dst_name
del src_dir_entry.contents[src_name]