Clearer error message

This commit is contained in:
Kovid Goyal 2012-11-06 12:56:00 +05:30
parent 5237c269ea
commit b318b128fe

View File

@ -309,8 +309,11 @@ class WindowsAtomicFolderMove(object):
handle = h handle = h
break break
if handle is None: if handle is None:
raise ValueError(u'The file %r did not exist when this move' if os.path.exists(path):
' operation was started'%path) raise ValueError(u'The file %r did not exist when this move'
' operation was started'%path)
else:
raise ValueError(u'The file %r does not exist'%path)
try: try:
win32file.CreateHardLink(dest, path) win32file.CreateHardLink(dest, path)
if os.path.getsize(dest) != os.path.getsize(path): if os.path.getsize(dest) != os.path.getsize(path):