tests/hghave
changeset 8213 ac9c4049fd29
parent 8127 17ab4dab50a6
child 8809 6fce36336e42
equal deleted inserted replaced
8212:bf795c34c63d 8213:ac9c4049fd29
    16     is matched by the supplied regular expression.
    16     is matched by the supplied regular expression.
    17     """
    17     """
    18     r = re.compile(regexp)
    18     r = re.compile(regexp)
    19     fh = os.popen(cmd)
    19     fh = os.popen(cmd)
    20     s = fh.read()
    20     s = fh.read()
    21     ret = fh.close()
    21     try:
       
    22         ret = fh.close()
       
    23     except IOError:
       
    24         # Happen in Windows test environment
       
    25         ret = 1
    22     return (ignorestatus or ret is None) and r.search(s)
    26     return (ignorestatus or ret is None) and r.search(s)
    23 
    27 
    24 def has_baz():
    28 def has_baz():
    25     return matchoutput('baz --version 2>&1', r'baz Bazaar version')
    29     return matchoutput('baz --version 2>&1', r'baz Bazaar version')
    26 
    30