Skip to content

Commit 933ac36

Browse files
committed
Add a delay for version check to allow stdout to be flushed. Closes #674
1 parent 5b7b842 commit 933ac36

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Azure.Functions.Cli/Helpers/PythonHelpers.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ private static async Task VerifyVersion()
7979
var exitCode = await exe.RunAsync(l => sb.AppendLine(l), e => sb.AppendLine(e));
8080
if (exitCode == 0)
8181
{
82+
var trials = 0;
83+
// this delay to make sure the output
84+
while (string.IsNullOrWhiteSpace(sb.ToString()) && trials < 5)
85+
{
86+
trials++;
87+
await Task.Delay(TimeSpan.FromMilliseconds(200));
88+
}
89+
8290
var output = sb.ToString();
8391
if (output.IndexOf("3.6") == -1)
8492
{

0 commit comments

Comments
 (0)