Index: utils/pub/io.dart |
diff --git a/utils/pub/io.dart b/utils/pub/io.dart |
index 665680e828ebc871f4c4cec1e81cc2a4fd8680ac..35dfe63f2c7abcad8eba79c6099b5dd80c365dd2 100644 |
--- a/utils/pub/io.dart |
+++ b/utils/pub/io.dart |
@@ -563,8 +563,11 @@ Future<String> consumeStringInputStream(StringInputStream stream) { |
/// Wraps [stream] in a single-subscription [Stream] that emits the same data. |
Stream<List<int>> wrapInputStream(InputStream stream) { |
- var controller = new StreamController.singleSubscription(); |
- if (stream.closed) return controller..close(); |
+ var controller = new StreamController(); |
+ if (stream.closed) { |
+ controller.close(); |
+ return controller.stream; |
+ } |
stream.onClosed = controller.close; |
stream.onData = () => controller.add(stream.read()); |