mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +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')
|
||||
|
||||
def get_pg_config(kind, pg_config="pg_config"):
|
||||
p = subprocess.Popen([pg_config, "--" + kind],
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
try:
|
||||
p = subprocess.Popen([pg_config, "--" + kind],
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
except OSError:
|
||||
raise Warning("Unable to find 'pg_config' file")
|
||||
p.stdin.close()
|
||||
r = p.stdout.readline().strip()
|
||||
if not r:
|
||||
|
|
Loading…
Reference in New Issue
Block a user