Ticket #11617: trac_11617.patch

File trac_11617.patch, 1.1 KB (added by was, 10 years ago)
  • sage/interfaces/gp.py

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1311284225 25200
    # Node ID f41b0b0ffdb444bb34c78da2fefaa4d8f17bfbf9
    # Parent  5485765a0afc8cb913799584904ff800a22e3c5f
    trac 11617: sending any large string at all to the gp PARI pexpect interface fails
    
    diff --git a/sage/interfaces/gp.py b/sage/interfaces/gp.py
    a b  
    377377       
    378378            sage: gp._eval_line('2+2')
    379379            '4'
     380
     381        TESTS:
     382
     383        We verify that trac 11617 is fixed::
     384
     385            sage: gp._eval_line('a='+str(range(2*10^5)))[:70]
     386            '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,'
    380387        """
    381388        line = line.strip()
    382389        if len(line) == 0:
     
    389396            b = self.eval("allocatemem()")
    390397            if b.find("Warning: not enough memory") != -1:
    391398                raise RuntimeError, a
    392             return self._eval_line(line)
     399            return self._eval_line(line, allow_use_file=allow_use_file,
     400                                   wait_for_prompt=wait_for_prompt)
    393401        else:
    394402            return a
    395403