gobject-introspection r989 - in trunk: . giscanner



Author: johan
Date: Tue Dec  9 15:19:57 2008
New Revision: 989
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=989&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/giscanner/cachestore.py

Modified: trunk/giscanner/cachestore.py
==============================================================================
--- trunk/giscanner/cachestore.py	(original)
+++ trunk/giscanner/cachestore.py	Tue Dec  9 15:19:57 2008
@@ -22,6 +22,7 @@
 import cPickle
 import hashlib
 import os
+import shutil
 import tempfile
 
 
@@ -105,8 +106,8 @@
                 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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]