[Pkg-sugar-commit] [sugar-terminal-activity] 01/02: Fix failure to start if older CWD is missing

Jonas Smedegaard dr at jones.dk
Fri Jun 19 02:57:41 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag v30
in repository sugar-terminal-activity.

commit 0d4c1919f4fbbc270553ff667f1954ef87ae8778
Author: Martin Langhoff <martin.langhoff at gmail.com>
Date:   Mon Nov 9 01:34:20 2009 +0530

    Fix failure to start if older CWD is missing
---
 terminal.py | 10 +++++++---
 1 file 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']:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sugar/sugar-terminal-activity.git



More information about the pkg-sugar-commit mailing list