By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,675 Members | 2,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,675 IT Pros & Developers. It's quick & easy.

PEP 324 error

P: n/a
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.
--
Andrew
Nov 19 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.