From 928e1ec237a7adcd469b3bcdd8da1220db085475 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 26 Jul 2015 02:06:14 +0300 Subject: [PATCH] Fix avoid write null logs --- slpkg/log_deps.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/slpkg/log_deps.py b/slpkg/log_deps.py index 5f2b1c9d..e3584ae5 100644 --- a/slpkg/log_deps.py +++ b/slpkg/log_deps.py @@ -41,7 +41,8 @@ def write_deps(deps_dict): os.mkdir(dep_path) if os.path.isfile(dep_path + name): os.remove(dep_path + name) - with open(dep_path + name, "w") as f: - for dep in dependencies: - f.write(dep + "\n") - f.close() + if len(dependencies) >= 1: + with open(dep_path + name, "w") as f: + for dep in dependencies: + f.write(dep + "\n") + f.close()