Skip to content

Commit

Permalink
Some grammar fixes, use American spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Apr 29, 2023
1 parent de277e2 commit 45f40b9
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions dbutils/pooled_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
db = pool.dedicated_connection()
If you don't need it any more, you should immediately return it to the
If you don't need it anymore, you should immediately return it to the
pool with db.close(). You can get another connection in the same way.
Warning: In a threaded environment, never do the following:
Expand Down Expand Up @@ -386,7 +386,7 @@ def __del__(self):
"""Delete the pool."""
try:
self.close()
except: # builtin Exceptions might not exist any more
except: # builtin Exceptions might not exist anymore
pass

def _wait_lock(self):
Expand Down Expand Up @@ -433,7 +433,7 @@ def __del__(self):
"""Delete the pooled connection."""
try:
self.close()
except: # builtin Exceptions might not exist any more
except: # builtin Exceptions might not exist anymore
pass

def __enter__(self):
Expand Down Expand Up @@ -525,7 +525,7 @@ def __del__(self):
"""Delete the pooled connection."""
try:
self.close()
except: # builtin Exceptions might not exist any more
except: # builtin Exceptions might not exist anymore
pass

def __enter__(self):
Expand Down
8 changes: 4 additions & 4 deletions dbutils/pooled_pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
proxy class for the hardened SteadyPg version of the connection.
The connection will not be shared with other threads. If you don't need
it any more, you should immediately return it to the pool with db.close().
it anymore, you should immediately return it to the pool with db.close().
You can get another connection in the same way or with db.reopen().
Warning: In a threaded environment, never do the following:
Expand Down Expand Up @@ -246,7 +246,7 @@ def __del__(self):
"""Delete the pool."""
try:
self.close()
except: # builtin Exceptions might not exist any more
except: # builtin Exceptions might not exist anymore
pass


Expand All @@ -267,7 +267,7 @@ def __init__(self, pool, con):
def close(self):
"""Close the pooled connection."""
# Instead of actually closing the connection,
# return it to the pool so it can be reused.
# return it to the pool so that it can be reused.
if self._con:
self._pool.cache(self._con)
self._con = None
Expand All @@ -292,7 +292,7 @@ def __del__(self):
"""Delete the pooled connection."""
try:
self.close()
except: # builtin Exceptions might not exist any more
except: # builtin Exceptions might not exist anymore
pass

def __enter__(self):
Expand Down
2 changes: 1 addition & 1 deletion dbutils/simple_pooled_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(self, pool, con):
def close(self):
"""Close the pooled connection."""
# Instead of actually closing the connection,
# return it to the pool so it can be reused.
# return it to the pool so that it can be reused.
if self._con is not None:
self._pool.returnConnection(self._con)
self._con = None
Expand Down
2 changes: 1 addition & 1 deletion dbutils/simple_pooled_pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(self, pool, con):
def close(self):
"""Close the pooled connection."""
# Instead of actually closing the connection,
# return it to the pool so it can be reused.
# return it to the pool so that it can be reused.
if self._con is not None:
self._pool.cache(self._con)
self._con = None
Expand Down
4 changes: 2 additions & 2 deletions dbutils/steady_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def __del__(self):
"""Delete the steady connection."""
try:
self._close() # make sure the connection is closed
except: # builtin Exceptions might not exist any more
except: # builtin Exceptions might not exist anymore
pass


Expand Down Expand Up @@ -708,5 +708,5 @@ def __del__(self):
"""Delete the steady cursor."""
try:
self.close() # make sure the cursor is closed
except: # builtin Exceptions might not exist any more
except: # builtin Exceptions might not exist anymore
pass
2 changes: 1 addition & 1 deletion dbutils/steady_pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,5 +305,5 @@ def __del__(self):
"""Delete the steady connection."""
try:
self._close() # make sure the connection is closed
except: # builtin Exceptions might not exist any more
except: # builtin Exceptions might not exist anymore
pass
4 changes: 2 additions & 2 deletions docs/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ <h3>PooledDB (pooled_db)</h3>
at least <span class="docutils literal">mincached</span> and at the most <span class="docutils literal">maxcached</span> idle connections that
will be used whenever a thread is requesting a dedicated database connection
or the pool of shared connections is not yet full. When a thread closes a
connection that is not shared any more, it is returned back to the pool of
connection that is not shared anymore, it is returned back to the pool of
idle connections so that it can be recycled again.</p>
<p>If the underlying DB-API module is not thread-safe, thread locks will be
used to ensure that the <span class="docutils literal">pooled_db</span> connections are thread-safe. So you
Expand Down Expand Up @@ -372,7 +372,7 @@ <h3>PooledDB (pooled_db)</h3>
<pre class="literal-block">db = pool.connection(shareable=False)</pre>
<p>Instead of this, you can also get a dedicated connection as follows:</p>
<pre class="literal-block">db = pool.dedicated_connection()</pre>
<p>If you don't need it any more, you should immediately return it to the
<p>If you don't need it anymore, you should immediately return it to the
pool with <span class="docutils literal">db.close()</span>. You can get another connection in the same way.</p>
<p><em>Warning:</em> In a threaded environment, never do the following:</p>
<pre class="literal-block">pool.connection().cursor().execute(...)</pre>
Expand Down
4 changes: 2 additions & 2 deletions docs/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Besides the pool of shared connections, you can also set up a pool of
at least ``mincached`` and at the most ``maxcached`` idle connections that
will be used whenever a thread is requesting a dedicated database connection
or the pool of shared connections is not yet full. When a thread closes a
connection that is not shared any more, it is returned back to the pool of
connection that is not shared anymore, it is returned back to the pool of
idle connections so that it can be recycled again.

If the underlying DB-API module is not thread-safe, thread locks will be
Expand Down Expand Up @@ -389,7 +389,7 @@ Instead of this, you can also get a dedicated connection as follows::

db = pool.dedicated_connection()

If you don't need it any more, you should immediately return it to the
If you don't need it anymore, you should immediately return it to the
pool with ``db.close()``. You can get another connection in the same way.

*Warning:* In a threaded environment, never do the following::
Expand Down

0 comments on commit 45f40b9

Please sign in to comment.