Index: utils/pub/io.dart |
diff --git a/utils/pub/io.dart b/utils/pub/io.dart |
index 665680e828ebc871f4c4cec1e81cc2a4fd8680ac..2a4e89b1684cfed57bf5d8fed70bcee6ae2ece83 100644 |
--- a/utils/pub/io.dart |
+++ b/utils/pub/io.dart |
@@ -610,19 +610,18 @@ class _OutputStreamConsumer implements StreamConsumer<List<int>, dynamic> { |
if (!completed) completer.completeError(e, stack); |
completed = true; |
} |
- }, onDone: () { |
- _outputStream.close(); |
- // TODO(nweiz): wait until _outputStream.onClosed is called once issue |
- // 7761 is fixed. |
- if (!completed) completer.complete(null); |
- completed = true; |
- }); |
+ }, onDone: () => _outputStream.close()); |
_outputStream.onError = (e) { |
if (!completed) completer.completeError(e); |
completed = true; |
}; |
+ _outputStream.onClosed = () { |
+ if (!completed) completer.complete(); |
+ completed = true; |
+ }; |
+ |
return completer.future; |
} |
} |