From 51ae7c92935e24427929b8a5042d2925ea959d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Schaerer?= Date: Tue, 17 Mar 2009 10:43:40 +0100 Subject: [PATCH] remove harmless error message --- autojump | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autojump b/autojump index be16061..5b353ba 100755 --- a/autojump +++ b/autojump @@ -37,7 +37,10 @@ def save(path_dict,dic_file): f.flush() os.fsync(f) f.close() - os.rename(dic_file+".tmp",dic_file) #cf. http://thunk.org/tytso/blog/2009/03/15/dont-fear-the-fsync/ + try: + os.rename(dic_file+".tmp",dic_file) #cf. http://thunk.org/tytso/blog/2009/03/15/dont-fear-the-fsync/ + except OSError: + pass #Fail quietly, this usually means a concurrent autojump process already did the job #import shutil #shutil.copy(dic_file+".tmp",dic_file) #cPickle.dump doesn't seem to be atomic, so this is more secure