
    5                     R    d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ d Z	y)	z(Helper functions for executing binaries.    )absolute_import)print_function)division)unicode_literalsN)	exceptionc                 h   t        j                  | t         j                  t         j                        }|j                         \  }}| t	        |t
              s|j                         }| t	        |t
              s|j                         }|j                  dk7  rt        j                  |      ||fS )zRuns external terminal command.

  Args:
    command_and_flags (List[str]): Ordered command and flag strings.

  Returns:
    (stdout (str|None), stderr (str|None)) from running command.

  Raises:
    OSError for any issues running the command.
  )stdoutstderrr   )

subprocessPopenPIPEcommunicate
isinstancestrdecode
returncoder   ExternalBinaryError)command_and_flagscommand_processcommand_stdoutcommand_stderrs       -platform/gsutil/gslib/utils/execution_util.pyExecuteExternalCommandr      s     $$%6,6OO,6OO=/ $3#>#>#@ .. 
>3(G#**,N
>3(G#**,N1$

'
'
77		''    )
__doc__
__future__r   r   r   r   r   gslibr   r    r   r   <module>r      s!    / & %  '  (r   