def getvalue(self):
"""Retrieve the entire contents"""
+ if sys.hexversion >= 0x3000000:
+ return bytes().join(self._read_data)
return "".join(self._read_data)
def close(self):
test_string = 2 * "blah blah blah\n"
master_fd, slave_fd = self._create_pipe()
- master_file = os.fdopen(master_fd, 'r')
+ master_file = os.fdopen(master_fd, 'rb')
task_scheduler = TaskScheduler(max_jobs=2)
scheduler = task_scheduler.sched_iface
task_scheduler.run()
+ if sys.hexversion >= 0x3000000:
+ test_string = test_string.encode()
+
self._assertEqual(test_string, consumer.getvalue())