Getting the exit code of a subprocess

2021-12-15 Thread Jason
Hello, How can I find out the exit code of a process when using the subprocess module? I am passing an email message to a shell script and I need to know whether the shell script threw an error. Here is my code: p = Popen(cmd, stdout=None, stdin=PIPE, stderr=None) p.communicate(input=msg) I tr

ast.parse, ast.dump, but with comment preservation?

2021-12-15 Thread samue...@gmail.com
I wrote a little open-source tool to expose internal constructs in OpenAPI. Along the way, I added related functionality to: - Generate/update a function prototype to/from a class - JSON schema - Automatically add type annotations to all function arguments, class attributes, declarations, and ass

Re: Getting the exit code of a subprocess

2021-12-15 Thread Kushal Kumaran
On Wed, Dec 15 2021 at 09:38:48 PM, Jason wrote: > Hello, > > How can I find out the exit code of a process when using the > subprocess module? I am passing an email message to a shell script and > I need to know whether the shell script threw an error. > > Here is my code: > p = Popen(cmd, stdout

Re: Getting the exit code of a subprocess

2021-12-15 Thread Jason
On Wed, Dec 15, 2021 at 08:19:16PM -0800, Kushal Kumaran wrote: > On Wed, Dec 15 2021 at 09:38:48 PM, Jason wrote: > > Hello, > > > > How can I find out the exit code of a process when using the > > subprocess module? I am passing an email message to a shell script and > > I need to know whether t

Re: ast.parse, ast.dump, but with comment preservation?

2021-12-15 Thread Chris Angelico
On Thu, Dec 16, 2021 at 2:47 PM samue...@gmail.com wrote: > > I wrote a little open-source tool to expose internal constructs in OpenAPI. > Along the way, I added related functionality to: > - Generate/update a function prototype to/from a class > - JSON schema > - Automatically add type annotati