From 414a6552143a1e2406bb980ed905969f4b778ad7 Mon Sep 17 00:00:00 2001
From: David Douard <david.douard@sdfa3.org>
Date: Mon, 23 Mar 2020 10:30:00 +0100
Subject: [PATCH] model: small code improvement of SkippedContent.from_dict

---
 swh/model/model.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/swh/model/model.py b/swh/model/model.py
index f6e8a5ba..5cc40afe 100644
--- a/swh/model/model.py
+++ b/swh/model/model.py
@@ -727,8 +727,7 @@ class SkippedContent(BaseContent):
 
     @classmethod
     def from_dict(cls, d):
-        d2 = d
-        d = d.copy()
-        if d.pop('data', None) is not None:
-            raise ValueError('SkippedContent has no "data" attribute %r' % d2)
-        return super().from_dict(d, use_subclass=False)
+        d2 = d.copy()
+        if d2.pop('data', None) is not None:
+            raise ValueError('SkippedContent has no "data" attribute %r' % d)
+        return super().from_dict(d2, use_subclass=False)
-- 
GitLab