make sure postgis test does not run on windows if no server is availabl

This commit is contained in:
Dane Springmeyer 2014-08-31 20:09:16 -07:00
parent f4ba1eba15
commit cfe79a6fe3
2 changed files with 8 additions and 2 deletions

View file

@ -31,7 +31,10 @@ def call(cmd,silent=False):
stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
if not stderr:
return stdin.strip()
elif not silent and 'error' in stderr.lower() or 'could not connect' in stderr.lower():
elif not silent and 'error' in stderr.lower() \
or 'could not connect' in stderr.lower() \
or 'bad connection' in stderr.lower() \
or 'not recognized as an internal' in stderr.lower():
raise RuntimeError(stderr.strip())
def psql_can_connect():

View file

@ -23,7 +23,10 @@ def call(cmd,silent=False):
stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
if not stderr:
return stdin.strip()
elif not silent and 'error' in stderr.lower() or 'could not connect' in stderr.lower():
elif not silent and 'error' in stderr.lower() \
or 'could not connect' in stderr.lower() \
or 'bad connection' in stderr.lower() \
or 'not recognized as an internal' in stderr.lower():
raise RuntimeError(stderr.strip())
def psql_can_connect():