Ticket #14066: trac_14066-startup.patch

File trac_14066-startup.patch, 787 bytes (added by jason, 9 years ago)
  • sage/misc/sage_extension.py

    # HG changeset patch
    # User Jason Grout <jason.grout@drake.edu>
    # Date 1360678652 21600
    # Node ID e015daaf1e6c2759833392bd72ffb1e2b8176422
    # Parent  5a4d4a90eb11b3dc4d8421e522fc6b378a667174
    Run startup files through the preparser
    
    diff --git a/sage/misc/sage_extension.py b/sage/misc/sage_extension.py
    a b  
    466466        """
    467467        startup_file = os.environ.get('SAGE_STARTUP_FILE', '')
    468468        if os.path.exists(startup_file):
    469             self.shell.run_cell('%%run %r'%startup_file)
     469            with open(startup_file, 'r') as f:
     470                self.shell.run_cell(f.read(), store_history=False)
    470471
    471472    def init_inspector(self):
    472473        # Ideally, these would just be methods of the Inspector class