summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@async.com.br>2008-12-09 15:19:57 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-12-09 15:19:57 +0000
commit517888c7425e68fdaabd3bc2199bee31d454036c (patch)
treede905b2a920a84b5d35fdbd018a28b094bdf5831
parentc1eb0a1670b41ffaa254310284a025ddc25c11a1 (diff)
downloadgobject-introspection-517888c7425e68fdaabd3bc2199bee31d454036c.tar.gz
Use shutil.move instead of os.rename, since it will automatically fall
2008-12-09 Johan Dahlin <johan@async.com.br> * giscanner/cachestore.py (CacheStore.store): Use shutil.move instead of os.rename, since it will automatically fall back to copying+remove if the src directory is on a different partition from the dst directory. svn path=/trunk/; revision=989
-rw-r--r--ChangeLog10
-rw-r--r--giscanner/cachestore.py5
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e5cb0031..ac7f8105 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
+2008-12-09 Johan Dahlin <johan@async.com.br>
+
+ * giscanner/cachestore.py (CacheStore.store): Use
+ shutil.move instead of os.rename, since it will
+ automatically fall back to copying+remove if the
+ src directory is on a different partition from
+ the dst directory.
+
2008-12-08 Tristan Van Berkom <tristan.van.berkom@gmail.com>
- Bug 563742 – introspection should record the introduced version of
+ Bug 563742 – introspection should record the introduced version of
symbols marked with the "Since:" tag
reviewed by: Johan
diff --git a/giscanner/cachestore.py b/giscanner/cachestore.py
index f7f0062a..5c4b5b49 100644
--- a/giscanner/cachestore.py
+++ b/giscanner/cachestore.py
@@ -22,6 +22,7 @@ import errno
import cPickle
import hashlib
import os
+import shutil
import tempfile
@@ -105,8 +106,8 @@ class CacheStore(object):
raise
try:
- os.rename(tmp_filename, store_filename)
- except OSError, e:
+ shutil.move(tmp_filename, store_filename)
+ except IOError, e:
# Permission denied
if e.errno == errno.EACCES:
self._remove_filename(tmp_filename)