Index: utils/pub/oauth2.dart |
diff --git a/utils/pub/oauth2.dart b/utils/pub/oauth2.dart |
index 5ce0cefa60e7acb088d20e7dcf7bafd2a4453715..44ac07f59de34fd298003be23ae3f08b32c33613 100644 |
--- a/utils/pub/oauth2.dart |
+++ b/utils/pub/oauth2.dart |
@@ -69,7 +69,7 @@ Future clearCredentials(SystemCache cache) { |
Future withClient(SystemCache cache, Future fn(Client client)) { |
return _getClient(cache).then((client) { |
var completer = new Completer(); |
- return asyncWhenComplete(fn(client), () { |
+ return fn(client).whenComplete(() { |
client.close(); |
// Be sure to save the credentials even when an error happens. |
return _saveCredentials(cache, client.credentials); |