Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F11023677
D8688.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
670 B
Subscribers
None
D8688.id.diff
View Options
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
Details
Attached
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
Attached To
D8688: model: Fix hypothesis integration with attr < 21.3.0
Event Timeline
Log In to Comment