Ticket #3942: trac_3942_pid-interfaces.patch

File trac_3942_pid-interfaces.patch, 1.3 kB (added by rlm, 4 months ago)
  • a/sage/interfaces/expect.py

    old new  
    5353 
    5454import cleaner 
    5555 
     56import os 
     57 
    5658from sage.misc.misc import SAGE_ROOT, verbose, SAGE_TMP_INTERFACE, LOCAL_IDENTIFIER 
    5759from sage.structure.element import RingElement 
    5860BAD_SESSION = -2 
    5961 
    6062failed_to_start = [] 
    6163 
    62 tmp_expect_interface_local='%s/tmp'%SAGE_TMP_INTERFACE 
     64#tmp_expect_interface_local='%s/tmp'%SAGE_TMP_INTERFACE 
     65 
     66def tmp_expect_interface_local(): 
     67    return '%s/tmp'%SAGE_TMP_INTERFACE + str(os.getpid()) 
    6368 
    6469## On some platforms, e.g., windows, this can easily take 10 seconds!?!  Terrible.  And 
    6570## it should not be necessary or used anyways.  
     
    545550        try: 
    546551            return self.__local_tmpfile 
    547552        except AttributeError: 
    548             self.__local_tmpfile = tmp_expect_interface_local 
     553            self.__local_tmpfile = tmp_expect_interface_local() 
    549554            return self.__local_tmpfile 
    550555 
    551556    def _remote_tmpdir(self):