PEP 324 error

A

Andrew

It appears PEP 324 is missing the part about check_call():

http://www.python.org/dev/peps/pep-0324/
....

This module also defines two shortcut functions:

- call(*args, **kwargs):
Run command with arguments. Wait for command to complete,
then return the returncode attribute.

The arguments are the same as for the Popen constructor.
Example:

retcode = call(["ls", "-l"])

Exceptions
----------
...


Note the lack of "two shortcut functions".

In the docstring of subprocess in python 2.5:

This module also defines two shortcut functions:

call(*popenargs, **kwargs):
Run command with arguments. Wait for command to complete, then
return the returncode attribute.

The arguments are the same as for the Popen constructor. Example:

retcode = call(["ls", "-l"])

check_call(*popenargs, **kwargs):
Run command with arguments. Wait for command to complete. If the
exit code was zero then return, otherwise raise
CalledProcessError. The CalledProcessError object will have the
return code in the returncode attribute.

The arguments are the same as for the Popen constructor. Example:

check_call(["ls", "-l"])

I don't know if check_call is going to be deprecated, but there still appears to be a missing function.
I'm not sure if this is the correct way to report errors, but I think it's prudent to keep the documentation comprehensive.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top