# HG changeset patch # User Martin von Zweigbergk # Date 1547745870 28800 # Node ID fabb0224a5990068b00e4c31f0542c646a74a0d7 # Parent 876494fd967d03e5a7ecac4b0f92c497c4fe60ea hghave: let OSError with ENOENT through like any other Before this patch, if we get an OSError with ENOENT, we would not re-raise it and would instead run into an undefined variable ("p") soon thereafter. Differential Revision: https://phab.mercurial-scm.org/D5631 diff -r 876494fd967d -r fabb0224a599 tests/hghave.py --- a/tests/hghave.py Thu Jan 17 09:17:12 2019 -0800 +++ b/tests/hghave.py Thu Jan 17 09:24:30 2019 -0800 @@ -1,6 +1,5 @@ from __future__ import absolute_import -import errno import os import re import socket @@ -118,13 +117,8 @@ is matched by the supplied regular expression. """ r = re.compile(regexp) - try: - p = subprocess.Popen( - cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - except OSError as e: - if e.errno != errno.ENOENT: - raise - ret = -1 + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) s = p.communicate()[0] ret = p.returncode return (ignorestatus or not ret) and r.search(s)