Handle OSError from os.path.samefile() (breakage from previous commit).
authorZac Medico <zmedico@gentoo.org>
Mon, 16 Aug 2010 10:34:12 +0000 (03:34 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 16 Aug 2010 10:34:12 +0000 (03:34 -0700)
pym/portage/dbapi/bintree.py

index 2863b5c5359e6548c872f22872f7b25a9327d745..5d152452b2f41ca80b200bb61deaec2b1553fa7e 100644 (file)
@@ -945,7 +945,11 @@ class binarytree(object):
                                wantnewlockfile=1)
                        if filename is not None:
                                new_filename = self.getname(cpv)
-                               if not os.path.samefile(filename, new_filename):
+                               try:
+                                       samefile = os.path.samefile(filename, new_filename)
+                               except OSError:
+                                       samefile = False
+                               if not samefile:
                                        self._ensure_dir(os.path.dirname(new_filename))
                                        _movefile(filename, new_filename, mysettings=self.settings)
                        if self._all_directory and \