mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-09-21 03:08:57 +03:00
Unclear error message when no pg_config found
If unable to find pg_config, a warning will be printed instead of stopping the build process and displaying a generic error message.
This commit is contained in:
parent
5a3e07a610
commit
ac1b5ce68a
11
setup.py
11
setup.py
|
@ -61,10 +61,13 @@ version_flags = ['dt', 'dec']
|
||||||
PLATFORM_IS_WINDOWS = sys.platform.lower().startswith('win')
|
PLATFORM_IS_WINDOWS = sys.platform.lower().startswith('win')
|
||||||
|
|
||||||
def get_pg_config(kind, pg_config="pg_config"):
|
def get_pg_config(kind, pg_config="pg_config"):
|
||||||
p = subprocess.Popen([pg_config, "--" + kind],
|
try:
|
||||||
stdin=subprocess.PIPE,
|
p = subprocess.Popen([pg_config, "--" + kind],
|
||||||
stdout=subprocess.PIPE,
|
stdin=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.PIPE)
|
||||||
|
except OSError:
|
||||||
|
raise Warning("Unable to find 'pg_config' file")
|
||||||
p.stdin.close()
|
p.stdin.close()
|
||||||
r = p.stdout.readline().strip()
|
r = p.stdout.readline().strip()
|
||||||
if not r:
|
if not r:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user