Permalink
Browse files

Fix regression from 7c811b5

  • Loading branch information...
jtackaberry committed Jan 19, 2012
1 parent 09b3c58 commit 93b82a00c3332064f10d48b62e1621fccf77c958
Showing with 10 additions and 10 deletions.
  1. +10 −10 src/io.py
View
@@ -553,8 +553,8 @@ def _pop_line_from_read_queue(self):
return s[:idx]
- def _abort_read_inprogress(self, exc, inprogress, signal):
- signal.disconnect(inprogress)
+ def _abort_read_inprogress(self, exc, signal, ip):
+ signal.disconnect(ip)
self._update_read_monitor()
@@ -570,7 +570,7 @@ def _async_read(self, signal):
return InProgress().finish(None)
ip = inprogress(signal)
- ip.signals['abort'].connect(self._abort_read_inprogress, inprogress, signal)
+ ip.signals['abort'].connect(self._abort_read_inprogress, signal, ip)
return ip
@@ -746,9 +746,9 @@ def _write(self, data):
return os.write(self.fileno, data)
- def _abort_write_inprogress(self, exc, inprogress):
+ def _abort_write_inprogress(self, exc, data, ip):
try:
- self._write_queue.remove((data, inprogress))
+ self._write_queue.remove((data, ip))
except ValueError:
# Too late to abort.
return False
@@ -789,17 +789,17 @@ def write(self, data):
if not isinstance(data, BYTES_TYPE):
raise ValueError('data must be bytes, not unicode')
- inprogress = InProgress()
+ ip = InProgress()
if data:
- inprogress.signals['abort'].connect(self._abort_write_inprogress, inprogress)
- self._write_queue.append((data, inprogress))
+ ip.signals['abort'].connect(self._abort_write_inprogress, data, ip)
+ self._write_queue.append((data, ip))
if self._channel and self._wmon and not self._wmon.active:
self._wmon.register(self.fileno, IO_WRITE)
else:
# We're writing the null string, nothing really to do. We're
# implicitly done.
- inprogress.finish(0)
- return inprogress
+ ip.finish(0)
+ return ip
def _handle_write(self):

0 comments on commit 93b82a0

Please sign in to comment.