-
-
Notifications
You must be signed in to change notification settings - Fork 394
Closed
Labels
Description
As discussed on gitter Process.__repr__ doesn't show the latest information:
In [28]: process = await trio.open_process(['git', 'status'], stdout=subprocess.DEVNULL)
In [29]: process
Out[29]: <trio.Process ['git', 'status']: running with PID 9888>
In [30]: !powershell -Command { 'ps -Id 9888' }
ps : Cannot find a process with the process identifier 9888.
At line:1 char:1
+ ps -Id 9888
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (9888:Int32) [Get-Process], ProcessCommandException
+ FullyQualifiedErrorId : NoProcessFoundForGivenId,Microsoft.PowerShell.Commands.GetProcessCommand
In [31]: process
Out[31]: <trio.Process ['git', 'status']: running with PID 9888>
In [32]: await process.wait()
Out[32]: 0
In [33]: process
Out[33]: <trio.Process ['git', 'status']: exited with status 0>Just opening this issue in case the situation can be improved by e.g. calling poll internally:
maybe
__repr__should automatically call.poll()to give up to date info?
Reactions are currently unavailable