Ticket #1241: sugar-1241-toolkit.3.patch

File sugar-1241-toolkit.3.patch, 1.2 KB (added by alsroot, 12 years ago)
  • src/sugar/datastore/datastore.py

    From d712461cfa535dff905d1951c1dd3d710afaad92 Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Thu, 17 Sep 2009 10:54:01 +0000
    Subject: Emulate missed parts of DSObject #1241
    
    ---
     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 b class RawObject(object): 
    170170    def get_file_path(self, fetch=True):
    171171        # we have to create symlink since its a common practice
    172172        # to create hardlinks to jobject files
     173        # and w/o this, it wouldn't work since we have file from mounted device
    173174        if self._file_path is None:
    174175            self._file_path = tempfile.mktemp(
    175176                    prefix='rawobject',
    class RawObject(object): 
    185186            return
    186187        self._destroyed = True
    187188        if self._file_path is not None:
    188             os.remove(self._file_path)
     189            if os.path.exists(self._file_path):
     190                os.remove(self._file_path)
    189191            self._file_path = None
    190192
    191193    def __del__(self):