Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Langhoff <martin.langhoff@gmail.com>2009-11-08 20:04:20 (GMT)
committer Sayamindu Dasgupta <sayamindu@gmail.com>2009-11-08 20:04:20 (GMT)
commit0d4c1919f4fbbc270553ff667f1954ef87ae8778 (patch)
tree2b2df903f776da147ebd1aa1f7f04b53d98fce9c
parentfa71f5f4915871b710981dbe6a8cc25ba3d7e329 (diff)
Fix failure to start if older CWD is missing
-rw-r--r--terminal.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/terminal.py b/terminal.py
index cc0a868..af410b1 100644
--- a/terminal.py
+++ b/terminal.py
@@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-import os, os.path, simplejson, ConfigParser
+import os, os.path, sys, simplejson, ConfigParser
from gettext import gettext as _
@@ -226,8 +226,12 @@ class TerminalActivity(sugar.activity.activity.Activity):
#os.environ['TERMINAL_ENV'] = '\n'.join(filtered_env)
# Restore the working directory.
- if tab_state.has_key('cwd'):
- os.chdir(tab_state['cwd'])
+ if tab_state.has_key('cwd') and os.path.exists(tab_state['cwd']):
+ try:
+ os.chdir(tab_state['cwd'])
+ except:
+ # ACLs may deny access
+ sys.stdout.write("Could not chdir to " + tab_state['cwd'])
# Restore the scrollback buffer.
for l in tab_state['scrollback']: