diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2010-04-16 22:36:32 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2010-04-16 22:36:32 +0900 |
commit | b259ba4db902d492d0676e1760f1d129a0c1e4c5 (patch) | |
tree | 525ccfe122cbeabb7b537491deee0e7b3d1914e3 /engine | |
parent | f6c1d1dde7179c26d07f8d7c9558866e6acb1886 (diff) | |
download | ibus-anthy-b259ba4db902d492d0676e1760f1d129a0c1e4c5.tar.gz |
Fix OSError when the link of zipcode.t is broken. #854
Diffstat (limited to 'engine')
-rw-r--r-- | engine/engine.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/engine/engine.py b/engine/engine.py index ab9a406..8498a0d 100644 --- a/engine/engine.py +++ b/engine/engine.py @@ -1415,6 +1415,9 @@ class Engine(ibus.EngineBase): @classmethod def _link_dict_file_with_id(cls, file, id, link_mode): + if not path.exists(file): + print >> sys.stderr, file + " does not exist" + return if id == None: return if link_mode == LINK_DICT_EMBEDDED: @@ -1433,7 +1436,7 @@ class Engine(ibus.EngineBase): os.makedirs(directory, 0700) backup_dir = os.getcwd() os.chdir(directory) - if path.exists(directory + '/' + name): + if path.lexists(directory + '/' + name): if path.islink(directory + '/' + name): print >> sys.stderr, "Removing " + name os.unlink(directory + '/' + name) @@ -1463,7 +1466,7 @@ class Engine(ibus.EngineBase): return backup_dir = os.getcwd() os.chdir(directory) - if path.exists(directory + '/' + name): + if path.lexists(directory + '/' + name): os.unlink(directory + '/' + name) if backup_dir != None: os.chdir(backup_dir) |