diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-09-18 10:31:13 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-09-18 10:31:13 (GMT) |
commit | dfc5513f86102fea29b8f6177f443774aa0ff7df (patch) | |
tree | 54472390a1c17906a0495e2a4ef674bb9647f93b | |
parent | 927c576e318a3aebd3217b35e1d4cf73582f0e4f (diff) |
To emulate missed parts of DSObject - optional file_path removing #1241
-rw-r--r-- | src/sugar/datastore/datastore.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sugar/datastore/datastore.py b/src/sugar/datastore/datastore.py index 0ad42b6..8d23721 100644 --- a/src/sugar/datastore/datastore.py +++ b/src/sugar/datastore/datastore.py @@ -170,6 +170,7 @@ class RawObject(object): def get_file_path(self, fetch=True): # we have to create symlink since its a common practice # to create hardlinks to jobject files + # and w/o this, it wouldn't work since we have file from mounted device if self._file_path is None: self._file_path = tempfile.mktemp( prefix='rawobject', @@ -185,7 +186,8 @@ class RawObject(object): return self._destroyed = True if self._file_path is not None: - os.remove(self._file_path) + if os.path.exists(self._file_path): + os.remove(self._file_path) self._file_path = None def __del__(self): |