Page MenuHomeSoftware Heritage

D8688.id.diff
No OneTemporary

D8688.id.diff

diff --git a/swh/model/model.py b/swh/model/model.py
--- a/swh/model/model.py
+++ b/swh/model/model.py
@@ -326,7 +326,15 @@
if validator is not None:
f = f.evolve(validator=validator)
new_fields.append(f)
- return new_fields
+ if attr.__version__ < "21.3.0":
+ # https://github.com/python-attrs/attrs/issues/821
+ from attr._make import _make_attr_tuple_class
+
+ attr_names = [f.name for f in new_fields]
+ AttrsClass = _make_attr_tuple_class(cls.__name__, attr_names)
+ return AttrsClass(new_fields)
+ else:
+ return new_fields
ModelType = TypeVar("ModelType", bound="BaseModel")

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 17, 4:56 PM (12 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222617

Event Timeline