__init__.py (9528:d05714c2ab9c) | __init__.py (11320:42ecb523c64a) |
---|---|
1# Copyright (c) 2008-2009 The Hewlett-Packard Development Company 2# Copyright (c) 2004-2006 The Regents of The University of Michigan 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 160 unchanged lines hidden (view full) --- 169 this is sorta like `cmd` in shell""" 170 from subprocess import Popen, PIPE, STDOUT 171 172 if isinstance(cmd, str): 173 cmd = cmd.split() 174 175 no_exception = 'exception' in kwargs 176 exception = kwargs.pop('exception', None) | 1# Copyright (c) 2008-2009 The Hewlett-Packard Development Company 2# Copyright (c) 2004-2006 The Regents of The University of Michigan 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 160 unchanged lines hidden (view full) --- 169 this is sorta like `cmd` in shell""" 170 from subprocess import Popen, PIPE, STDOUT 171 172 if isinstance(cmd, str): 173 cmd = cmd.split() 174 175 no_exception = 'exception' in kwargs 176 exception = kwargs.pop('exception', None) |
177 | 177 |
178 kwargs.setdefault('shell', False) 179 kwargs.setdefault('stdout', PIPE) 180 kwargs.setdefault('stderr', STDOUT) 181 kwargs.setdefault('close_fds', True) 182 try: 183 subp = Popen(cmd, **kwargs) 184 except Exception, e: 185 if no_exception: --- 13 unchanged lines hidden --- | 178 kwargs.setdefault('shell', False) 179 kwargs.setdefault('stdout', PIPE) 180 kwargs.setdefault('stderr', STDOUT) 181 kwargs.setdefault('close_fds', True) 182 try: 183 subp = Popen(cmd, **kwargs) 184 except Exception, e: 185 if no_exception: --- 13 unchanged lines hidden --- |