This commit is contained in:
Mattias Andrée 2012-08-21 19:45:35 +02:00
parent 49e7ad42eb
commit 8ac0aceadc

View file

@ -570,8 +570,13 @@ class Ponysay():
if cachev is not None: if cachev is not None:
cachev.close() cachev.close()
if newversion: if newversion:
for cached in os.listdir(ponydir): for cached in os.listdir(cachedir):
shutil.rmtree(cachedir + '/' + cached, False) 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: try:
cachev = open(cachedir + '/.version', 'w+') cachev = open(cachedir + '/.version', 'w+')
cachev.write(KMS_VERSION) cachev.write(KMS_VERSION)