Skip to content

Commit c6fb387

Browse files
committed
typo and black
1 parent 4732c39 commit c6fb387

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

test_twarc2.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,7 @@ def test_ensure_flattened():
511511

512512
def test_ensure_flattened_errors():
513513
"""
514-
Test that ensure_flattened doesn't return tweets only contain errors and
515-
that lack content.
514+
Test that ensure_flattened doesn't return tweets for API responses that only contain errors.
516515
"""
517516
data = {"errors": ["fake error"]}
518517
assert twarc.expansions.ensure_flattened(data) == []

twarc/client2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def _stream(self, url, params, event, record_keepalive, tries=30):
11781178
log.error(f"too many consecutive errors ({tries}). stopping")
11791179
return
11801180
else:
1181-
secs = errors ** 2
1181+
secs = errors**2
11821182
log.info("sleeping %s seconds before reconnecting", secs)
11831183
time.sleep(secs)
11841184

twarc/decorators2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def new_f(*args, **kwargs):
9191
if errors > tries:
9292
log.warning(f"too many errors ({tries}) from Twitter, giving up")
9393
resp.raise_for_status()
94-
seconds = errors ** 2
94+
seconds = errors**2
9595
log.warning(
9696
"caught %s from Twitter API, sleeping %s", resp.status_code, seconds
9797
)
@@ -142,7 +142,7 @@ def new_f(self, *args, **kwargs):
142142
if errors > tries:
143143
log.error(f"giving up, too many request exceptions: {tries}")
144144
raise e
145-
seconds = errors ** 2
145+
seconds = errors**2
146146
log.info("sleeping %s", seconds)
147147
time.sleep(seconds)
148148
self.connect()

0 commit comments

Comments
 (0)