Ticket #1327: sugar-1327.patch

File sugar-1327.patch, 1.0 KB (added by alsroot, 12 years ago)
  • src/sugar/profile.py

    From 6f557f54da31dcd8705d149b6d88b95a60a0729d Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Tue, 15 Sep 2009 12:34:31 +0000
    Subject: Error while initiating .sugar environment #1327
    
    ---
     src/sugar/profile.py |    8 ++++++++
     1 files changed, 8 insertions(+), 0 deletions(-)
    
    diff --git a/src/sugar/profile.py b/src/sugar/profile.py
    index e5f5dc7..6737e4d 100644
    a b class Profile(object): 
    6565
    6666    def _load_pubkey(self):
    6767        key_path = os.path.join(env.get_profile_path(), 'owner.key.pub')
     68
     69        if not os.path.exists(key_path):
     70            return None
     71
    6872        try:
    6973            f = open(key_path, "r")
    7074            lines = f.readlines()
    class Profile(object): 
    9195
    9296    def _hash_private_key(self):
    9397        key_path = os.path.join(env.get_profile_path(), 'owner.key')
     98
     99        if not os.path.exists(key_path):
     100            return None
     101
    94102        try:
    95103            f = open(key_path, "r")
    96104            lines = f.readlines()