summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2013-12-25 17:12:11 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2013-12-26 03:46:36 -0500
commit38a0a43547f550dc1fa36c12bc727b3d072d0efa (patch)
treede356947c4bb5951e13ecd79885d525793ce3a8c /setup.py
parenta4ef31a7ef2a5465fb4fa17e26578b6cdadedc23 (diff)
downloadpycurl-38a0a43547f550dc1fa36c12bc727b3d072d0efa.tar.gz
Reraise OSError as ConfigurationError with a pointer toward the fix
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index c5d2235..d36bd28 100644
--- a/setup.py
+++ b/setup.py
@@ -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