| Index: sdk/lib/_internal/pub/lib/src/io.dart
|
| diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
|
| index 90b06f9aebf8670929df79aca3925ea430bf927e..88779aeb69b409e1dad6e50b1c167098554902fa 100644
|
| --- a/sdk/lib/_internal/pub/lib/src/io.dart
|
| +++ b/sdk/lib/_internal/pub/lib/src/io.dart
|
| @@ -5,7 +5,7 @@
|
| /// Helper functionality to make working with IO easier.
|
| library pub.io;
|
|
|
| -import 'dart:async' hide TimeoutException;
|
| +import 'dart:async';
|
| import 'dart:collection';
|
| import 'dart:convert';
|
| import 'dart:io';
|
| @@ -630,10 +630,12 @@ Future _doProcess(Function fn, String executable, List<String> args,
|
| /// Note that timing out will not cancel the asynchronous operation behind
|
| /// [input].
|
| Future timeout(Future input, int milliseconds, String description) {
|
| + // TODO(nwiez): Replace this with [Future.timeout].
|
| var completer = new Completer();
|
| - var timer = new Timer(new Duration(milliseconds: milliseconds), () {
|
| + var duration = new Duration(milliseconds: milliseconds);
|
| + var timer = new Timer(duration, () {
|
| completer.completeError(new TimeoutException(
|
| - 'Timed out while $description.'),
|
| + 'Timed out while $description.', duration),
|
| new Trace.current());
|
| });
|
| input.then((value) {
|
| @@ -816,15 +818,6 @@ ByteStream createTarGz(List contents, {baseDir}) {
|
| return new ByteStream(controller.stream);
|
| }
|
|
|
| -/// Exception thrown when an operation times out.
|
| -class TimeoutException implements Exception {
|
| - final String message;
|
| -
|
| - const TimeoutException(this.message);
|
| -
|
| - String toString() => message;
|
| -}
|
| -
|
| /// Contains the results of invoking a [Process] and waiting for it to complete.
|
| class PubProcessResult {
|
| final List<String> stdout;
|
|
|