Compare commits

...
Author SHA1 Message Date
Rafa Audibert 480a18b582 fix: Fix syntax warning
This is a syntax error in Python 3.8+ (it was deprecated earlier and became an error). The return statement should be moved outside the finally block.

We've never noticed this, but we can see it because of the new github action added on https://github.com/PostHog/posthog-python/pull/404
2026-01-07 22:16:17 -03:00
pauldambra 78482b188c chore: check for syntax warnings 2026-01-07 22:56:11 +00:00
4 changed files with 30 additions and 2 deletions
+23
View File
@@ -76,6 +76,29 @@ jobs:
run: |
pytest --verbose --timeout=30
import-check:
name: Python ${{ matrix.python-version }} import check
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
with:
fetch-depth: 1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
with:
python-version: ${{ matrix.python-version }}
- name: Install posthog
run: pip install .
- name: Check import produces no warnings
run: python -W error -c "import posthog"
django5-integration:
name: Django 5 integration tests
runs-on: ubuntu-latest
+4
View File
@@ -1,3 +1,7 @@
# 7.5.1 - 2026-01-08
fix: Fix incorrect syntax with `return` inside `finally` block
# 7.5.0 - 2026-01-06
feat: Capture Langchain, OpenAI and Anthropic errors as exceptions (if exception autocapture is enabled)
+2 -1
View File
@@ -89,7 +89,8 @@ class Consumer(Thread):
# mark items as acknowledged from queue
for item in batch:
self.queue.task_done()
return success
return success
def next(self):
"""Return the next batch of items to upload."""
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION = "7.5.0"
VERSION = "7.5.1"
if __name__ == "__main__":
print(VERSION, end="") # noqa: T201