diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-08-21 19:45:35 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-08-21 19:45:35 +0200 |
commit | 8ac0aceadcadb4241d04ab65897a47b9e817d4b4 (patch) | |
tree | 140d2f994c3a5d6635dd4f874d7d102a7b9f26a1 | |
parent | 49e7ad42ebc79462d6827c8a5316adeeade43fcb (diff) | |
download | ponysay-8ac0aceadcadb4241d04ab65897a47b9e817d4b4.tar.gz ponysay-8ac0aceadcadb4241d04ab65897a47b9e817d4b4.tar.bz2 ponysay-8ac0aceadcadb4241d04ab65897a47b9e817d4b4.zip |
derp
-rwxr-xr-x | ponysay | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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) |