From e4dcbbcbc28591a075591c8edb5a47cd7a65f2b9 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 4 Aug 2015 01:38:26 +0300 Subject: [PATCH] Fix check files for merge --- slpkg/new_config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slpkg/new_config.py b/slpkg/new_config.py index ecaef92b..6766eff5 100644 --- a/slpkg/new_config.py +++ b/slpkg/new_config.py @@ -207,8 +207,10 @@ class NewConfig(object): def merge(self, n): """Merge new file into old """ - old = Utils().read_file(n[:-4]).splitlines() - new = Utils().read_file(n).splitlines() + if os.path.isfile(n[:-4]): + old = Utils().read_file(n[:-4]).splitlines() + if os.path.isfile(n): + new = Utils().read_file(n).splitlines() with open(n[:-4], "w") as out: for l1, l2 in itertools.izip_longest(old, new): if l1 is None: