Skip to content

Commit 9d2e454

Browse files
committed
fix: Avoid return from finally: block
This fixes a SyntaxWarning on Python 3.14. ``` ❯ uvx --no-cache --python 3.14.0 --with posthog==6.7.11 python -c "import posthog" Installed 11 packages in 5ms .../lib/python3.14/site-packages/posthog/consumer.py:92: SyntaxWarning: 'return' in a 'finally' block return success ````
1 parent 50b0c71 commit 9d2e454

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

posthog/consumer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ def upload(self):
8585
success = False
8686
if self.on_error:
8787
self.on_error(e, batch)
88-
finally:
89-
# mark items as acknowledged from queue
90-
for item in batch:
91-
self.queue.task_done()
92-
return success
88+
89+
# mark items as acknowledged from queue
90+
for item in batch:
91+
self.queue.task_done()
92+
return success
9393

9494
def next(self):
9595
"""Return the next batch of items to upload."""

0 commit comments

Comments
 (0)