| 1 |
From: Scott Christley <[email protected]> |
| 2 |
Date: Wed, 28 Jan 2026 02:08:51 +0000 |
| 3 |
Subject: replace deprecated resource_stream |
| 4 |
|
| 5 |
Origin: https://github.com/airr-community/airr-standards/commit/f5b69ca6f43d1e1d1cb1d5634aab8bc1f0d1061e |
| 6 |
Bug-Debian: https://bugs.debian.org/1083596 |
| 7 |
Last-Update: 2026-01-28 |
| 8 |
--- |
| 9 |
airr/schema.py | 6 +++--- |
| 10 |
1 file changed, 3 insertions(+), 3 deletions(-) |
| 11 |
|
| 12 |
diff --git a/airr/schema.py b/airr/schema.py |
| 13 |
index 28967d3..298b020 100644 |
| 14 |
--- a/airr/schema.py |
| 15 |
+++ b/airr/schema.py |
| 16 |
@@ -7,12 +7,12 @@ import sys |
| 17 |
import yaml |
| 18 |
import yamlordereddictloader |
| 19 |
from collections import OrderedDict |
| 20 |
-from pkg_resources import resource_stream |
| 21 |
+import importlib.resources |
| 22 |
|
| 23 |
-with resource_stream(__name__, 'specs/airr-schema.yaml') as f: |
| 24 |
+# For Python 3.9+ |
| 25 |
+with importlib.resources.files(__name__).joinpath('specs/airr-schema.yaml').open('rb') as f: |
| 26 |
DEFAULT_SPEC = yaml.load(f, Loader=yamlordereddictloader.Loader) |
| 27 |
|
| 28 |
- |
| 29 |
class ValidationError(Exception): |
| 30 |
""" |
| 31 |
Exception raised when validation errors are encountered. |