summarylogtreecommitdiffstats
path: root/sagemath-pexpect-4.8.patch
blob: a0bc81954d0e2637faaf10b4d424dddffa7feba3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff --git a/src/sage/interfaces/sagespawn.pyx b/src/sage/interfaces/sagespawn.pyx
index 8da000ffd1..8644b08029 100644
--- a/src/sage/interfaces/sagespawn.pyx
+++ b/src/sage/interfaces/sagespawn.pyx
@@ -149,7 +149,8 @@ class SageSpawn(spawn):
             u'hello world\r\n'
         """
         ret = self.expect(*args, **kwds)
-        self.buffer = self.before + self.after + self.buffer
+        self._before = self.buffer_type()
+        self._before.write(self.before + self.after + self.buffer)
         return ret
 
     def expect_upto(self, *args, **kwds):
@@ -167,7 +168,8 @@ class SageSpawn(spawn):
             u'world\r\n'
         """
         ret = self.expect(*args, **kwds)
-        self.buffer = self.after + self.buffer
+        self._before = self.buffer_type()
+        self._before.write(self.after + self.buffer)
         return ret