Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Oct 11, 2024
1 parent 712f120 commit 84a75fc
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ init-hook =
# comments at the end of the line does the same thing (though Py3 supports
# mixing)


# too-many-positional-arguments: we inherit most of these and can't do anything about them.
# invalid-name, ; We get lots of these, especially in scripts. should fix many of them
# protected-access, ; We have many cases of this; legit ones need to be examinid and commented, then this removed
# no-self-use, ; common in superclasses with extension points
Expand Down Expand Up @@ -146,7 +146,8 @@ disable=wrong-import-position,
missing-param-doc,
differing-param-doc,
differing-type-doc,
compare-to-zero
compare-to-zero,
too-many-positional-arguments

enable=consider-using-augmented-assign

Expand Down
3 changes: 1 addition & 2 deletions src/relstorage/adapters/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ def select_from(self, columns, table, suffix='', timeout=None, **kw):
timeout,
kw
):
for row in cursor.fetchall():
yield row
yield from cursor.fetchall()

def update_set_static(self, update_set, timeout=None,
batch_done_callback=lambda total_count: None,
Expand Down
3 changes: 1 addition & 2 deletions src/relstorage/adapters/mysql/drivers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ def __iter__(self):
sleep = self.sleep
batch = fetch()
while batch:
for row in batch:
yield row
yield from batch
if sleep is not None:
sleep() # pylint:disable=not-callable
batch = fetch()
Expand Down
1 change: 1 addition & 0 deletions src/relstorage/adapters/oracle/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def _create(self):
twophase = self._twophase
options = self.options
dsn = self._dsn
inputsizes = None

batcher_factory = lambda cursor, row_limit=None: OracleRowBatcher(
cursor, inputsizes, row_limit
Expand Down
2 changes: 1 addition & 1 deletion src/relstorage/adapters/oracle/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def replace_var(match):
new_name = '%s_%d' % (name, rownum) # pylint:disable=used-before-assignment
if name in self.inputsizes:
stmt_inputsizes[new_name] = self.inputsizes[name]
params[new_name] = row[name]
params[new_name] = row[name] # pylint:disable=possibly-used-before-assignment
return ':%s' % new_name

items = sorted(self.inserts.items())
Expand Down
3 changes: 1 addition & 2 deletions src/relstorage/cache/tests/test_mvcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,7 @@ class MockRowBatcher(RowBatcher):
def select_from(self, *args, **kwargs):
# pylint:disable=signature-differs
try:
for x in RowBatcher.select_from(self, *args, **kwargs):
yield x
yield from RowBatcher.select_from(self, *args, **kwargs)
except AggregateOperationTimeoutError as ex:
MockRowBatcher.ex = ex
raise
Expand Down
3 changes: 1 addition & 2 deletions src/relstorage/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,7 @@ def __record_iternext_gen(self, start_oid_int):
# at least so it seems. So here we make sure to have the cursor open.
getattr(self._load_connection, 'cursor')
with self._load_connection.server_side_cursor() as ss_cursor:
for record in self._adapter.dbiter.iter_current_records(ss_cursor, start_oid_int):
yield record
yield from self._adapter.dbiter.iter_current_records(ss_cursor, start_oid_int)

def record_iternext(self, next=None): # pylint:disable=redefined-builtin
"""
Expand Down
1 change: 1 addition & 0 deletions src/relstorage/storage/tpc/vote.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ def tpc_finish(self, storage, transaction, f=None, _time=time.time):
raise StorageTransactionError(
"tpc_finish called with wrong transaction")
try:
locks_released = 0
finish_entry = _time()
# Handle the finishing. We cannot/must not fail now.
# TODO: Move most of this into the Finish class/module.
Expand Down
3 changes: 1 addition & 2 deletions src/relstorage/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ def close(self):
self.closed = True

def __iter__(self):
for row in self.results:
yield row
yield from self.results

class MockOptions(Options):
cache_module_name = '' # disable
Expand Down

0 comments on commit 84a75fc

Please sign in to comment.