From 9c4a1057a2a1dfc1d1b408a2b789f12bca18e078 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 7 Feb 2015 02:44:31 +0200 Subject: [PATCH] fix OSError: [Errno2] --- slpkg/init.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/slpkg/init.py b/slpkg/init.py index d3eea82f..b78f1e49 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -559,10 +559,11 @@ class Initialization(object): '/ChangeLog.txt') if os.path.isfile(changelogs): os.remove(changelogs) - for f in os.listdir(self.lib_path + '{0}_repo/'.format(repo)): - packages = '{0}{1}_repo/{2}'.format(self.lib_path, repo, f) - if os.path.isfile(packages): - os.remove(packages) + if os.path.isdir(self.lib_path + '{0}_repo/'.format(repo)): + for f in os.listdir(self.lib_path + '{0}_repo/'.format(repo)): + files = '{0}{1}_repo/{2}'.format(self.lib_path, repo, f) + if os.path.isfile(files): + os.remove(files) Update().repository()