#12719: Upgrade to IPython 0.13
----------------------------------------------------------+-----------------
       Reporter:  kini                                    |         Owner:  tbd 
                                                  
           Type:  enhancement                             |        Status:  
needs_work                                            
       Priority:  critical                                |     Milestone:  
sage-pending                                          
      Component:  packages                                |    Resolution:      
                                                  
       Keywords:  sd40.5                                  |   Work issues:      
                                                  
Report Upstream:  N/A                                     |     Reviewers:  
Volker Braun, Mike Hansen, Jason Grout, Jeroen Demeyer
        Authors:  Mike Hansen, Volker Braun, Jason Grout  |     Merged in:      
                                                  
   Dependencies:  #13459, #9191                           |      Stopgaps:      
                                                  
----------------------------------------------------------+-----------------

Comment (by jdemeyer):

 In `SageInteractiveShell.system_raw`, does `libraries` refer to a global
 or is that variable simply unused?  Since `false` isn't guaranteed to
 return exit status 1 (on Solaris, it returns 255), the doctest must be
 changed to something more portable. I also don't see this function
 discussed on #975.

 So, I suggest the following patch:
 {{{
 #!patch
 diff --git a/sage/misc/interpreter.py b/sage/misc/interpreter.py
 --- a/sage/misc/interpreter.py
 +++ b/sage/misc/interpreter.py
 @@ -161,26 +161,18 @@ class SageInteractiveShell(TerminalInter

      def system_raw(self, cmd):
          """
 -        Adjust the libraries before calling system commands.  See Trac
 -        #975 for a discussion of this function.
 +        Run a system command.

          EXAMPLES::

              sage: from sage.misc.interpreter import get_test_shell
              sage: shell = get_test_shell()
              sage: shell.system_raw('false')
 -            sage: shell.user_ns['_exit_code']
 -            256
 +            sage: status = shell.user_ns['_exit_code']
 +            sage: os.WIFEXITED(status) and os.WEXITSTATUS(status) != 0
 +            True
          """
 -        sage_commands = os.listdir(os.environ['SAGE_ROOT']+"/local/bin/")
 -        DARWIN_SYSTEM = os.uname()[0]=='Darwin'
 -        if cmd in sage_commands:
 -            return super(SageInteractiveShell, self).system_raw(cmd)
 -        else:
 -            libraries = 'LD_LIBRARY_PATH=$$SAGE_ORIG_LD_LIBRARY_PATH;'
 -            if DARWIN_SYSTEM:
 -                libraries +=
 'DYLD_LIBRARY_PATH=$$SAGE_ORIG_DYLD_LIBRARY_PATH;'
 -            return super(SageInteractiveShell, self).system_raw(cmd)
 +        return super(SageInteractiveShell, self).system_raw(cmd)

      def ask_exit(self):
          """
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12719#comment:189>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to