diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2013-12-25 17:12:11 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2013-12-26 03:46:36 -0500 |
commit | 38a0a43547f550dc1fa36c12bc727b3d072d0efa (patch) | |
tree | de356947c4bb5951e13ecd79885d525793ce3a8c /setup.py | |
parent | a4ef31a7ef2a5465fb4fa17e26578b6cdadedc23 (diff) | |
download | pycurl-38a0a43547f550dc1fa36c12bc727b3d072d0efa.tar.gz |
Reraise OSError as ConfigurationError with a pointer toward the fix
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -167,8 +167,13 @@ else: include_dirs.append(os.path.join(OPENSSL_DIR, "include")) CURL_CONFIG = os.environ.get('PYCURL_CURL_CONFIG', "curl-config") CURL_CONFIG = scan_argv("--curl-config=", CURL_CONFIG) - p = subprocess.Popen((CURL_CONFIG, '--version'), - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + try: + p = subprocess.Popen((CURL_CONFIG, '--version'), + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + except OSError: + exc = sys.exc_info()[1] + msg = 'Could not run curl-config: %s' % str(exc) + raise ConfigurationError(msg) stdout, stderr = p.communicate() if p.wait() != 0: msg = "`%s' not found -- please install the libcurl development files or specify --curl-config=/path/to/curl-config" % CURL_CONFIG |