diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-12-03 18:47:19 -0800 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2017-12-10 10:51:07 -0800 |
commit | 9de46e416e5ac1be1c5ff170d1c1ada5b8d7278f (patch) | |
tree | 62291426bc36f26ed5ac65d597ed15a5654a4e22 /examples/threads.py | |
parent | ef64493b8913e4069c4422ad14da6de405c445f6 (diff) | |
download | psycopg2-9de46e416e5ac1be1c5ff170d1c1ada5b8d7278f.tar.gz |
Use print() function instead of print statement throughout project
Forward compatible with newer Pythons.
Diffstat (limited to 'examples/threads.py')
-rw-r--r-- | examples/threads.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/threads.py b/examples/threads.py index e0be7e0..49a495c 100644 --- a/examples/threads.py +++ b/examples/threads.py @@ -45,7 +45,7 @@ if len(sys.argv) > 1: if len(sys.argv) > 2: MODE = int(sys.argv[2]) -print "Opening connection using dsn:", DSN +print("Opening connection using dsn:", DSN) conn = psycopg2.connect(DSN) curs = conn.cursor() @@ -77,7 +77,7 @@ def insert_func(conn_or_pool, rows): if MODE == 1: conn_or_pool.putconn(conn) s = name + ": COMMIT STEP " + str(i) - print s + print(s) if MODE == 1: conn = conn_or_pool.getconn() c = conn.cursor() @@ -85,8 +85,8 @@ def insert_func(conn_or_pool, rows): c.execute("INSERT INTO test_threads VALUES (%s, %s, %s)", (str(i), i, float(i))) except psycopg2.ProgrammingError as err: - print name, ": an error occurred; skipping this insert" - print err + print(name, ": an error occurred; skipping this insert") + print(err) conn.commit() ## a nice select function that prints the current number of rows in the |