Skip to content

Commit

Permalink
python3 print
Browse files Browse the repository at this point in the history
QGIS would not build with the old print statements
  • Loading branch information
fnorf authored and m-kuhn committed Dec 16, 2016
1 parent 9c1638f commit 0c894d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/grass/scripts/db.connect-login.pg.py
Expand Up @@ -106,20 +106,20 @@ def main():

# Unfortunately we cannot test untill user/password is set
if user or password:
print "Setting login (db.login) ... "
print("Setting login (db.login) ... ")
sys.stdout.flush()
if grass.run_command('db.login', driver="pg", database=conn, user=user, password=password) != 0:
grass.fatal("Cannot login")

# Try to connect
print "Testing connection ..."
print("Testing connection ...")
sys.stdout.flush()
if grass.run_command('db.select', quiet=True, flags='c', driver="pg", database=conn, sql="select version()") != 0:
if user or password:
print "Deleting login (db.login) ..."
print("Deleting login (db.login) ...")
sys.stdout.flush()
if grass.run_command('db.login', quiet=True, driver="pg", database=conn, user="", password="") != 0:
print "Cannot delete login."
print("Cannot delete login.")
sys.stdout.flush()
grass.fatal("Cannot connect to database.")

Expand Down

0 comments on commit 0c894d7

Please sign in to comment.