Skip to content

Commit 321da6d

Browse files
committed
ruff
1 parent 316d6b5 commit 321da6d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dictdatabase/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ def seek_index_through_value_bytes(json_bytes: bytes, index: int) -> int:
124124
return i
125125
i += 1
126126

127-
raise TypeError("Invalid JSON")
127+
msg = "Invalid JSON"
128+
raise TypeError(msg)
128129

129130

130131
def count_nesting_in_bytes(json_bytes: bytes, start: int, end: int) -> int:
@@ -222,7 +223,7 @@ def detect_indentation_in_json_bytes(json_bytes: bytes, index: int) -> Tuple[int
222223
- A tuple of the indentation level and the whitespace used
223224
"""
224225

225-
indentation_bytes, contains_tab = bytes(), False
226+
indentation_bytes, contains_tab = b"", False
226227
for i in range(index - 1, -1, -1):
227228
if json_bytes[i] not in [byte_codes.SPACE, byte_codes.TAB]:
228229
break

tests/benchmark/run_parallel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import random
66
import shutil
77
import time
8-
from calendar import c
98
from dataclasses import dataclass
109
from multiprocessing import Pool
1110
from typing import Callable
@@ -110,7 +109,7 @@ def parallel_stressor(scenario: Scenario):
110109
# Create Tables
111110
for t in range(scenario.files):
112111
if scenario.big_file:
113-
with open(os.path.join(os.getcwd(), "test_db/production_database/tasks.json"), "r") as f:
112+
with open(os.path.join(os.getcwd(), "test_db/production_database/tasks.json")) as f:
114113
db = json.loads(f.read())
115114
db["counter"] = {"counter": 0}
116115
else:

0 commit comments

Comments
 (0)