recent changes

John Arbash Meinel john at arbash-meinel.com
Mon Jun 20 17:32:31 BST 2005


John Arbash Meinel wrote:

>I also think we would want to use "subprocess" if it is available, and
>fall back to something that looks a lot like it.
>Because you can install it as a module for 2.3, it is built-in to 2.4,
>and it is much nicer than os.system, or popen*
>
>
>
Just to clarify this statement. On non-windows platforms, subprocess.py
is just a simple python wrapper around some of the other functions, so
we could easily bundle it. On windows, we could just require python 2.4
for running the test suite (we already require it :).

I think it makes a lot of sense to get away from os.system,
subprocess.call is a lot cleaner. It even allows using pipes, etc in the
shell if you pass the "shell=True" flag.

I'm guessing the easiest thing to do is to just copy subprocess.py into
the working directory and rename it to something like
"bundled_subprocess.py"

And then you can do:

try:
    import subprocess
except ImportError:
    import bundled_subprocess as subprocess

Or you could just create a wrapper module, which did "from subprocess
import *" and was aware that it couldn't import the bundled subprocess
module on windows, and would through an appropriate exception.


John
=:->



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050620/489fa03d/attachment.pgp 


More information about the bazaar mailing list