Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project
adheres to [Semantic Versioning](https://semver.org/).

## Unreleased

### :bug: Fixes

- Raise an exception at both build and runtime when using an unsupported Python version,
instead of crashing with a segmentation fault at runtime (in the rare cases where
`backports.zstd` was installed despite the `requires-python` marker)

## [1.2.0] - 2025-12-06

[1.2.0]: https://github.com/rogdham/backports.zstd/releases/tag/v1.2.0
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

from setuptools import Extension, setup

if not ((3, 9) <= sys.version_info < (3, 14)):
raise RuntimeError(f"Unsupported Python version: {sys.version}")


# create a LICENSE_zstd.txt file
# wheels distributions needs to ship the license of the zstd library
ROOT_PATH = Path(__file__).parent.absolute()
Expand Down
4 changes: 4 additions & 0 deletions src/python/backports/zstd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"""Python bindings to the Zstandard (zstd) compression library (RFC-8878)."""

import sys
if not ((3, 9) <= sys.version_info < (3, 14)):
raise RuntimeError(f"Unsupported Python version: {sys.version}")

__all__ = (
# backports.zstd
'COMPRESSION_LEVEL_DEFAULT',
Expand Down