From 8ab9cf574ead8a1265e33b9c1feff334bcc15d7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20O=C5=BCarowski?= <piotr@debian.org>
Date: Thu, 20 Jan 2011 19:43:22 +0100
Subject: [PATCH] make sure fpath2 and fpath3 exists before comparing

---
 dh_python2 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dh_python2 b/dh_python2
index b35f60a..cf00ba7 100755
--- a/dh_python2
+++ b/dh_python2
@@ -280,7 +280,8 @@ def share_2x(dir1, dir2, dc=None):
                     os.rename(fpath1, fpath3)
                     relative_symlink(fpath3, fpath1)
                     relative_symlink(fpath3, fpath2)
-        elif fcmp(fpath2, fpath3, shallow=False):
+        elif exists(fpath2) and exists(fpath3) and \
+             fcmp(fpath2, fpath3, shallow=False):
             os.remove(fpath2)
             relative_symlink(fpath3, fpath2)
     for dn, dc in common_dirs:
-- 
GitLab