From 8ac0aceadcadb4241d04ab65897a47b9e817d4b4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 21 Aug 2012 19:45:35 +0200 Subject: derp --- ponysay | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ponysay') diff --git a/ponysay b/ponysay index 175fa63..82f16b9 100755 --- a/ponysay +++ b/ponysay @@ -570,8 +570,13 @@ class Ponysay(): if cachev is not None: cachev.close() if newversion: - for cached in os.listdir(ponydir): - shutil.rmtree(cachedir + '/' + cached, False) + for cached in os.listdir(cachedir): + cached = cachedir + '/' + cached + if os.path.isdir(cached) and not os.path.islink(cached): + shutil.rmtree(cached, False) + else: + os.remove(cached) + cachev = None try: cachev = open(cachedir + '/.version', 'w+') cachev.write(KMS_VERSION) -- cgit