summaryrefslogtreecommitdiff
path: root/lib/extras.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-03-12 19:37:22 -0700
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2019-03-13 11:13:05 +0000
commit03bb44dd2ca1e4ff8cd53469e2c5f2fa5361c084 (patch)
treebccb9a142f7fa2f1a02f5fb0feb96153e073e5cd /lib/extras.py
parent18f5d5ad05b1df2d1ac9fad8aa2e65be02b7553f (diff)
downloadpsycopg2-03bb44dd2ca1e4ff8cd53469e2c5f2fa5361c084.tar.gz
Convert `while 1:` statements to `while True:`
A slightly more readable and modern syntax.
Diffstat (limited to 'lib/extras.py')
-rw-r--r--lib/extras.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/extras.py b/lib/extras.py
index 0ae2582..94fee28 100644
--- a/lib/extras.py
+++ b/lib/extras.py
@@ -116,7 +116,7 @@ class DictCursorBase(_cursor):
first = next(res)
yield first
- while 1:
+ while True:
yield next(res)
except StopIteration:
return
@@ -378,7 +378,7 @@ class NamedTupleCursor(_cursor):
yield nt._make(t)
- while 1:
+ while True:
yield nt._make(next(it))
except StopIteration:
return
@@ -773,7 +773,7 @@ def wait_select(conn):
import select
from psycopg2.extensions import POLL_OK, POLL_READ, POLL_WRITE
- while 1:
+ while True:
try:
state = conn.poll()
if state == POLL_OK:
@@ -1172,7 +1172,7 @@ def _paginate(seq, page_size):
"""
page = []
it = iter(seq)
- while 1:
+ while True:
try:
for i in range(page_size):
page.append(next(it))