From 21bb84f62764c4933edd2273be510afe6d2e21aa Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 6 Apr 2021 02:50:51 -0400 Subject: [PATCH] fix lint errors --- archivebox/search/backends/sonic.py | 7 +++++-- archivebox/system.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/archivebox/search/backends/sonic.py b/archivebox/search/backends/sonic.py index 0d7a4605..38c187fa 100644 --- a/archivebox/search/backends/sonic.py +++ b/archivebox/search/backends/sonic.py @@ -13,10 +13,13 @@ MAX_SONIC_TEXT_CHUNK_LENGTH = 2000 # dont index more than 2000 characte def index(snapshot_id: str, texts: List[str]): with IngestClient(SEARCH_BACKEND_HOST_NAME, SEARCH_BACKEND_PORT, SEARCH_BACKEND_PASSWORD) as ingestcl: for text in texts: - max_length = 1000000 chunks = ( text[i:i+MAX_SONIC_TEXT_CHUNK_LENGTH] - for i in range(0, min(len(text), MAX_SONIC_TEXT_TOTAL_LENGTH), MAX_SONIC_TEXT_CHUNK_LENGTH) + for i in range( + 0, + min(len(text), MAX_SONIC_TEXT_TOTAL_LENGTH), + MAX_SONIC_TEXT_CHUNK_LENGTH, + ) ) for chunk in chunks: ingestcl.push(SONIC_COLLECTION, SONIC_BUCKET, snapshot_id, str(chunk)) diff --git a/archivebox/system.py b/archivebox/system.py index 502e2461..2dd12297 100644 --- a/archivebox/system.py +++ b/archivebox/system.py @@ -68,7 +68,7 @@ def run(*args, input=None, capture_output=True, timeout=None, check=False, text= # force kill any straggler subprocesses that were forked from the main proc try: os.killpg(pgid, signal.SIGINT) - except Exception as e: + except Exception: pass return CompletedProcess(process.args, retcode, stdout, stderr)